home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2.patch
Text File  |  1993-08-12  |  124KB  |  4,016 lines

  1. Prereq: 100
  2. *** ../tcl7.0b1/patchlevel.h    Fri Jun 18 13:56:34 1993
  3. --- patchlevel.h    Mon Jul 19 16:48:25 1993
  4. ***************
  5. *** 6,16 ****
  6.    * release or patch release.  It's used to make sure that Tcl
  7.    * patches are applied in the correct order and only to appropriate
  8.    * sources.
  9. -  *
  10. -  * The #define below makes the patch level available from within
  11. -  * Tcl.  The official level used by the "patch" program is immediately
  12. -  * below.  It must use the same number as the #define.
  13. -  * PatchLevel100
  14.    */
  15.   
  16. ! #define TCL_PATCH_LEVEL 100
  17. --- 6,11 ----
  18.    * release or patch release.  It's used to make sure that Tcl
  19.    * patches are applied in the correct order and only to appropriate
  20.    * sources.
  21.    */
  22.   
  23. ! #define TCL_PATCH_LEVEL 101
  24. *** ../tcl7.0b1/./Makefile.in    Fri Jul  9 13:41:02 1993
  25. --- ./Makefile.in    Mon Jul 19 16:24:48 1993
  26. ***************
  27. *** 15,21 ****
  28.   # Default top-level directories in which to install architecture-
  29.   # specific files (exec_prefix) and machine-independent files such
  30.   # as scripts (prefix).  The values specified here may be overridden
  31. ! # at configure-time with the --exec_prefix and --prefix options
  32.   # to the "configure" script.
  33.   
  34.   exec_prefix =    /usr/local
  35. --- 15,21 ----
  36.   # Default top-level directories in which to install architecture-
  37.   # specific files (exec_prefix) and machine-independent files such
  38.   # as scripts (prefix).  The values specified here may be overridden
  39. ! # at configure-time with the --exec-prefix and --prefix options
  40.   # to the "configure" script.
  41.   
  42.   exec_prefix =    /usr/local
  43. ***************
  44. *** 35,50 ****
  45.   # Directory in which to install the include file tcl.h:
  46.   INCLUDE_DIR =    $(prefix)/include
  47.   
  48.   # Directory in which to install manual entry for tclsh:
  49. ! MAN1_DIR =    $(prefix)/man/man1
  50.   
  51.   # Directory in which to install manual entries for Tcl's C library
  52.   # procedures:
  53. ! MAN3_DIR =    $(prefix)/man/man3
  54.   
  55.   # Directory in which to install manual entries for the built-in
  56.   # Tcl commands:
  57. ! MANN_DIR =    $(prefix)/man/mann
  58.   
  59.   # To change the compiler switches, for example to change from -O
  60.   # to -g, change the following line:
  61. --- 35,53 ----
  62.   # Directory in which to install the include file tcl.h:
  63.   INCLUDE_DIR =    $(prefix)/include
  64.   
  65. + # Top-level directory for manual entries:
  66. + MAN_DIR =    $(prefix)/man
  67.   # Directory in which to install manual entry for tclsh:
  68. ! MAN1_DIR =    $(MAN_DIR)/man1
  69.   
  70.   # Directory in which to install manual entries for Tcl's C library
  71.   # procedures:
  72. ! MAN3_DIR =    $(MAN_DIR)/man3
  73.   
  74.   # Directory in which to install manual entries for the built-in
  75.   # Tcl commands:
  76. ! MANN_DIR =    $(MAN_DIR)/mann
  77.   
  78.   # To change the compiler switches, for example to change from -O
  79.   # to -g, change the following line:
  80. ***************
  81. *** 63,68 ****
  82. --- 66,78 ----
  83.   MATH_LIBS = -lm
  84.   #MATH_LIBS =
  85.   
  86. + # If you would like for Tcl to override the UNIX functions "setenv",
  87. + # "unsetenv", and "putenv", so that the "env" variable automatically
  88. + # gets updated whenever these functions are called, then reverse the
  89. + # comment characters on the following two lines:
  90. + ENV_FLAGS =
  91. + # ENV_FLAGS = -DTclSetEnv=setenv -DTclUnsetEnv=unsetenv -DTclPutEnv=putenv
  92.   # To compile for non-UNIX systems (so that only the non-UNIX-specific
  93.   # commands are available), reverse the comment characters on the
  94.   # following pairs of lines.  In addition, you'll have to provide your
  95. ***************
  96. *** 109,120 ****
  97.   
  98.   CC =        cc
  99.   CFLAGS =    ${CC_SWITCHES} -I. -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} \
  100. ! ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
  101.   -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  102.   
  103. ! GENERIC_OBJS =    regexp.o tclAppInit.o tclBasic.o tclCkalloc.o tclCmdAH.o \
  104.       tclCmdIL.o tclCmdMZ.o tclExpr.o tclGet.o tclHash.o \
  105. !     tclHistory.o tclLink.o tclMtherr.o tclParse.o tclProc.o \
  106.       tclUtil.o tclVar.o
  107.   
  108.   OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
  109. --- 119,130 ----
  110.   
  111.   CC =        cc
  112.   CFLAGS =    ${CC_SWITCHES} -I. -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} \
  113. ! ${ENV_FLAGS} ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
  114.   -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  115.   
  116. ! GENERIC_OBJS =    regexp.o tclBasic.o tclCkalloc.o tclCmdAH.o \
  117.       tclCmdIL.o tclCmdMZ.o tclExpr.o tclGet.o tclHash.o \
  118. !     tclHistory.o tclLink.o tclParse.o tclProc.o \
  119.       tclUtil.o tclVar.o
  120.   
  121.   OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
  122. ***************
  123. *** 126,149 ****
  124.       ar cr libtcl.a ${OBJS}
  125.       $(RANLIB) libtcl.a
  126.   
  127. ! tclsh: libtcl.a
  128.       ${CC} ${CFLAGS} tclAppInit.o libtcl.a ${MATH_LIBS} -o tclsh
  129.   
  130. ! tcltest: libtcl.a tclTest.o
  131.       ${CC} ${CFLAGS} tclTest.o libtcl.a ${MATH_LIBS} -o tcltest
  132.   
  133.   test: tcltest
  134.       @cwd=`pwd`; \
  135.       cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
  136. !     cd $$cwd; ( echo cd tests\; source all ) | ./tcltest
  137.   
  138. ! install: libtcl.a tclsh
  139. !     @for i in $(LIB_DIR) $(BIN_DIR) $(INCLUDE_DIR) $(TCL_LIBRARY) \
  140. !         $(MAN1_DIR) $(MAN3_DIR) $(MANN_DIR) ; \
  141.           do \
  142.           if [ ! -d $$i ] ; then \
  143.           echo "Making directory $$i"; \
  144. !         mkdir -p $$i; \
  145.           chmod 755 $$i; \
  146.           else true; \
  147.           fi; \
  148. --- 136,160 ----
  149.       ar cr libtcl.a ${OBJS}
  150.       $(RANLIB) libtcl.a
  151.   
  152. ! tclsh: tclAppInit.o libtcl.a
  153.       ${CC} ${CFLAGS} tclAppInit.o libtcl.a ${MATH_LIBS} -o tclsh
  154.   
  155. ! tcltest: tclTest.o libtcl.a
  156.       ${CC} ${CFLAGS} tclTest.o libtcl.a ${MATH_LIBS} -o tcltest
  157.   
  158.   test: tcltest
  159.       @cwd=`pwd`; \
  160.       cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
  161. !     cd $$cwd; ( echo cd $(SRC_DIR)/tests\; source all ) | ./tcltest
  162. ! install: install-binaries install-libraries
  163.   
  164. ! install-binaries: libtcl.a tclsh
  165. !     @for i in $(LIB_DIR) $(BIN_DIR) ; \
  166.           do \
  167.           if [ ! -d $$i ] ; then \
  168.           echo "Making directory $$i"; \
  169. !         mkdir $$i; \
  170.           chmod 755 $$i; \
  171.           else true; \
  172.           fi; \
  173. ***************
  174. *** 153,158 ****
  175. --- 164,181 ----
  176.       @$(RANLIB) $(LIB_DIR)/libtcl.a
  177.       @echo "Installing tclsh"
  178.       @$(INSTALL_PROGRAM) tclsh $(BIN_DIR)
  179. + install-libraries:
  180. +     @for i in $(prefix)/lib $(INCLUDE_DIR) $(TCL_LIBRARY) \
  181. +         $(MAN_DIR) $(MAN1_DIR) $(MAN3_DIR) $(MANN_DIR) ; \
  182. +         do \
  183. +         if [ ! -d $$i ] ; then \
  184. +         echo "Making directory $$i"; \
  185. +         mkdir $$i; \
  186. +         chmod 755 $$i; \
  187. +         else true; \
  188. +         fi; \
  189. +         done;
  190.       @echo "Installing tcl.h"
  191.       @$(INSTALL_DATA) $(SRC_DIR)/tcl.h $(INCLUDE_DIR)
  192.       @cd $(SRC_DIR)/library; for i in *.tcl tclIndex; \
  193. *** ../tcl7.0b1/./tclProc.c    Wed Jun 16 16:01:26 1993
  194. --- ./tclProc.c    Sat Jul 17 14:50:32 1993
  195. ***************
  196. *** 26,32 ****
  197.    */
  198.   
  199.   #ifndef lint
  200. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclProc.c,v 1.64 93/06/16 16:01:21 ouster Exp $ SPRITE (Berkeley)";
  201.   #endif
  202.   
  203.   #include "tclInt.h"
  204. --- 26,32 ----
  205.    */
  206.   
  207.   #ifndef lint
  208. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclProc.c,v 1.65 93/07/17 14:50:15 ouster Exp $ SPRITE (Berkeley)";
  209.   #endif
  210.   
  211.   #include "tclInt.h"
  212. ***************
  213. *** 202,220 ****
  214.                    * if global frame indicated). */
  215.   {
  216.       register Interp *iPtr = (Interp *) interp;
  217. !     int level, result;
  218.       CallFrame *framePtr;
  219.   
  220. -     if (iPtr->varFramePtr == NULL) {
  221. -     iPtr->result = "already at top level";
  222. -     return -1;
  223. -     }
  224.       /*
  225.        * Parse string to figure out which level number to go to.
  226.        */
  227.   
  228.       result = 1;
  229.       if (*string == '#') {
  230.       if (Tcl_GetInt(interp, string+1, &level) != TCL_OK) {
  231.           return -1;
  232. --- 202,216 ----
  233.                    * if global frame indicated). */
  234.   {
  235.       register Interp *iPtr = (Interp *) interp;
  236. !     int curLevel, level, result;
  237.       CallFrame *framePtr;
  238.   
  239.       /*
  240.        * Parse string to figure out which level number to go to.
  241.        */
  242.   
  243.       result = 1;
  244. +     curLevel = (iPtr->varFramePtr == NULL) ? 0 : iPtr->varFramePtr->level;
  245.       if (*string == '#') {
  246.       if (Tcl_GetInt(interp, string+1, &level) != TCL_OK) {
  247.           return -1;
  248. ***************
  249. *** 229,237 ****
  250.       if (Tcl_GetInt(interp, string, &level) != TCL_OK) {
  251.           return -1;
  252.       }
  253. !     level = iPtr->varFramePtr->level - level;
  254.       } else {
  255. !     level = iPtr->varFramePtr->level - 1;
  256.       result = 0;
  257.       }
  258.   
  259. --- 225,233 ----
  260.       if (Tcl_GetInt(interp, string, &level) != TCL_OK) {
  261.           return -1;
  262.       }
  263. !     level = curLevel - level;
  264.       } else {
  265. !     level = curLevel - 1;
  266.       result = 0;
  267.       }
  268.   
  269. *** ../tcl7.0b1/./tclVar.c    Thu Jul  1 15:26:02 1993
  270. --- ./tclVar.c    Mon Jul 19 08:19:45 1993
  271. ***************
  272. *** 29,35 ****
  273.    */
  274.   
  275.   #ifndef lint
  276. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclVar.c,v 1.40 93/07/01 15:25:58 ouster Exp $ SPRITE (Berkeley)";
  277.   #endif
  278.   
  279.   #include "tclInt.h"
  280. --- 29,35 ----
  281.    */
  282.   
  283.   #ifndef lint
  284. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclVar.c,v 1.42 93/07/19 08:19:38 ouster Exp $ SPRITE (Berkeley)";
  285.   #endif
  286.   
  287.   #include "tclInt.h"
  288. ***************
  289. *** 488,505 ****
  290.       }
  291.   
  292.       /*
  293. -      * Compute how many total bytes will be needed for the
  294. -      * variable (leave space for a separating space between list
  295. -      * elements).
  296. -      */
  297. -     if (flags & TCL_LIST_ELEMENT) {
  298. -     length = Tcl_ScanElement(newValue, &listFlags) + 1;
  299. -     } else {
  300. -     length = strlen(newValue);
  301. -     }
  302. -     /*
  303.        * Clear the variable's current value unless this is an
  304.        * append operation.
  305.        */
  306. --- 488,493 ----
  307. ***************
  308. *** 1665,1671 ****
  309.       if (otherPtr == NULL) {
  310.       return TCL_ERROR;
  311.       }
  312. !     hPtr = Tcl_CreateHashEntry(&iPtr->varFramePtr->varTable, myName, &new);
  313.       if (new) {
  314.       varPtr = NewVar();
  315.       Tcl_SetHashValue(hPtr, varPtr);
  316. --- 1653,1663 ----
  317.       if (otherPtr == NULL) {
  318.       return TCL_ERROR;
  319.       }
  320. !     if (iPtr->varFramePtr != NULL) {
  321. !     hPtr = Tcl_CreateHashEntry(&iPtr->varFramePtr->varTable, myName, &new);
  322. !     } else {
  323. !     hPtr = Tcl_CreateHashEntry(&iPtr->globalTable, myName, &new);
  324. !     }
  325.       if (new) {
  326.       varPtr = NewVar();
  327.       Tcl_SetHashValue(hPtr, varPtr);
  328. *** ../tcl7.0b1/./tclExpr.c    Thu Jul  8 09:59:05 1993
  329. --- ./tclExpr.c    Mon Jul 19 15:21:25 1993
  330. ***************
  331. *** 29,35 ****
  332.    */
  333.   
  334.   #ifndef lint
  335. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclExpr.c,v 1.53 93/07/08 09:58:56 ouster Exp $ SPRITE (Berkeley)";
  336.   #endif
  337.   
  338.   #include "tclInt.h"
  339. --- 29,35 ----
  340.    */
  341.   
  342.   #ifndef lint
  343. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclExpr.c,v 1.56 93/07/19 15:21:13 ouster Exp $ SPRITE (Berkeley)";
  344.   #endif
  345.   
  346.   #include "tclInt.h"
  347. ***************
  348. *** 218,225 ****
  349. --- 218,227 ----
  350.    * libtcl.a has been processed, so Tcl's version won't be used.
  351.    */
  352.   
  353. + #ifdef NEED_MATHERR
  354.   extern int matherr();
  355.   int (*tclMatherrPtr)() = matherr;
  356. + #endif
  357.   
  358.   /*
  359.    * Declarations for local procedures to this file:
  360. ***************
  361. *** 331,346 ****
  362.       Value *valuePtr;        /* Where to store value information. 
  363.                    * Caller must have initialized pv field. */
  364.   {
  365. !     char *term;
  366. !     /*
  367. !      * Try to convert the string to a number.
  368. !      */
  369.   
  370.       if (*string != 0) {
  371.       valuePtr->type = TYPE_INT;
  372.       errno = 0;
  373. !     valuePtr->intValue = strtol(string, &term, 0);
  374.       if (errno == ERANGE) {
  375.           /*
  376.            * This procedure is sometimes called with string in
  377. --- 333,361 ----
  378.       Value *valuePtr;        /* Where to store value information. 
  379.                    * Caller must have initialized pv field. */
  380.   {
  381. !     char *term, *p;
  382.   
  383.       if (*string != 0) {
  384.       valuePtr->type = TYPE_INT;
  385.       errno = 0;
  386. !     /*
  387. !      * Note: use strtoul instead of strtol for integer conversions
  388. !      * to allow full-size unsigned numbers, but don't depend on
  389. !      * strtoul to handle sign characters;  it won't in some
  390. !      * implementations.
  391. !      */
  392. !     for (p = string; isspace(*p); p++) {
  393. !         /* Empty loop body. */
  394. !     }
  395. !     if (*p == '-') {
  396. !         valuePtr->intValue = -strtoul(p+1, &term, 0);
  397. !     } else if (*p == '+') {
  398. !         valuePtr->intValue = strtoul(p+1, &term, 0);
  399. !     } else {
  400. !         valuePtr->intValue = strtoul(p, &term, 0);
  401. !     }
  402.       if (errno == ERANGE) {
  403.           /*
  404.            * This procedure is sometimes called with string in
  405. ***************
  406. *** 358,370 ****
  407.           return TCL_OK;
  408.       }
  409.       errno = 0;
  410. !     valuePtr->doubleValue = strtod(string, &term);
  411. !     if (errno != 0) {
  412. !         Tcl_ResetResult(interp);
  413. !         ExprFloatError(interp, valuePtr->doubleValue);
  414. !         return TCL_ERROR;
  415. !     }
  416. !     if (*term == '\0') {
  417.           valuePtr->type = TYPE_DOUBLE;
  418.           return TCL_OK;
  419.       }
  420. --- 373,385 ----
  421.           return TCL_OK;
  422.       }
  423.       errno = 0;
  424. !     valuePtr->doubleValue = strtod(p, &term);
  425. !     if ((term != p) && (*term == '\0')) {
  426. !         if (errno != 0) {
  427. !         Tcl_ResetResult(interp);
  428. !         ExprFloatError(interp, valuePtr->doubleValue);
  429. !         return TCL_ERROR;
  430. !         }
  431.           valuePtr->type = TYPE_DOUBLE;
  432.           return TCL_OK;
  433.       }
  434. ***************
  435. *** 463,473 ****
  436.       
  437.           errno = 0;
  438.           valuePtr->doubleValue = strtod(p, &term2);
  439. -         if (errno != 0) {
  440. -         ExprFloatError(interp, valuePtr->doubleValue);
  441. -         return TCL_ERROR;
  442. -         }
  443.           if (term2 != p) {
  444.           infoPtr->token = VALUE;
  445.           infoPtr->expr = term2;
  446.           valuePtr->type = TYPE_DOUBLE;
  447. --- 478,488 ----
  448.       
  449.           errno = 0;
  450.           valuePtr->doubleValue = strtod(p, &term2);
  451.           if (term2 != p) {
  452. +         if (errno != 0) {
  453. +             ExprFloatError(interp, valuePtr->doubleValue);
  454. +             return TCL_ERROR;
  455. +         }
  456.           infoPtr->token = VALUE;
  457.           infoPtr->expr = term2;
  458.           valuePtr->type = TYPE_DOUBLE;
  459. *** ../tcl7.0b1/./tclGet.c    Sat Feb  6 16:20:35 1993
  460. --- ./tclGet.c    Mon Jul 12 11:35:29 1993
  461. ***************
  462. *** 27,33 ****
  463.    */
  464.   
  465.   #ifndef lint
  466. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclGet.c,v 1.12 93/02/06 16:20:34 ouster Exp $ SPRITE (Berkeley)";
  467.   #endif /* not lint */
  468.   
  469.   #include "tclInt.h"
  470. --- 27,33 ----
  471.    */
  472.   
  473.   #ifndef lint
  474. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclGet.c,v 1.13 93/07/12 11:35:14 ouster Exp $ SPRITE (Berkeley)";
  475.   #endif /* not lint */
  476.   
  477.   #include "tclInt.h"
  478. ***************
  479. *** 58,67 ****
  480.                    * integer in a form acceptable to strtol. */
  481.       int *intPtr;        /* Place to store converted result. */
  482.   {
  483. !     char *end;
  484.       int i;
  485.   
  486. !     i = strtol(string, &end, 0);
  487.       while ((*end != '\0') && isspace(*end)) {
  488.       end++;
  489.       }
  490. --- 58,82 ----
  491.                    * integer in a form acceptable to strtol. */
  492.       int *intPtr;        /* Place to store converted result. */
  493.   {
  494. !     char *end, *p;
  495.       int i;
  496.   
  497. !     /*
  498. !      * Note: use strtoul instead of strtol for integer conversions
  499. !      * to allow full-size unsigned numbers, but don't depend on strtoul
  500. !      * to handle sign characters;  it won't in some implementations.
  501. !      */
  502. !     for (p = string; isspace(*p); p++) {
  503. !     /* Empty loop body. */
  504. !     }
  505. !     if (*p == '-') {
  506. !     i = -strtoul(p+1, &end, 0);
  507. !     } else if (*p == '+') {
  508. !     i = strtoul(p+1, &end, 0);
  509. !     } else {
  510. !     i = strtoul(p, &end, 0);
  511. !     }
  512.       while ((*end != '\0') && isspace(*end)) {
  513.       end++;
  514.       }
  515. *** ../tcl7.0b1/./panic.c    Sat Feb  6 16:20:44 1993
  516. --- ./panic.c    Mon Jul 12 14:01:40 1993
  517. ***************
  518. *** 27,37 ****
  519.    */
  520.   
  521.   #ifndef lint
  522. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/panic.c,v 1.4 93/02/06 16:20:43 ouster Exp $ SPRITE (Berkeley)";
  523.   #endif
  524.   
  525.   #include <stdio.h>
  526. ! #include <stdlib.h>
  527.   
  528.   /*
  529.    *----------------------------------------------------------------------
  530. --- 27,41 ----
  531.    */
  532.   
  533.   #ifndef lint
  534. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/panic.c,v 1.5 93/07/12 14:01:35 ouster Exp $ SPRITE (Berkeley)";
  535.   #endif
  536.   
  537.   #include <stdio.h>
  538. ! #ifdef NO_STDLIB_H
  539. ! #   include "compat/stdlib.h"
  540. ! #else
  541. ! #   include <stdlib.h>
  542. ! #endif
  543.   
  544.   /*
  545.    *----------------------------------------------------------------------
  546. *** ../tcl7.0b1/./tclEnv.c    Thu Jul  8 09:59:28 1993
  547. --- ./tclEnv.c    Mon Jul 19 10:05:56 1993
  548. ***************
  549. *** 26,44 ****
  550.    */
  551.   
  552.   #ifndef lint
  553. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclEnv.c,v 1.14 93/07/08 09:59:27 ouster Exp $ SPRITE (Berkeley)";
  554.   #endif /* not lint */
  555.   
  556.   /*
  557. !  * The putenv definition below causes any system prototype for putenv
  558. !  * to be ignored so that there won't be a clash when the version of
  559. !  * putenv in this file is compiled.
  560.    */
  561.   
  562.   #define putenv ignore_putenv
  563.   #include "tclInt.h"
  564.   #include "tclUnix.h"
  565.   #undef putenv
  566.   
  567.   /*
  568.    * The structure below is used to keep track of all of the interpereters
  569. --- 26,46 ----
  570.    */
  571.   
  572.   #ifndef lint
  573. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclEnv.c,v 1.16 93/07/19 10:05:42 ouster Exp $ SPRITE (Berkeley)";
  574.   #endif /* not lint */
  575.   
  576.   /*
  577. !  * The putenv and setenv definitions below cause any system prototypes for
  578. !  * those procedures to be ignored so that there won't be a clash when the
  579. !  * versions in this file are compiled.
  580.    */
  581.   
  582.   #define putenv ignore_putenv
  583. + #define setenv ignore_setenv
  584.   #include "tclInt.h"
  585.   #include "tclUnix.h"
  586.   #undef putenv
  587. + #undef setenv
  588.   
  589.   /*
  590.    * The structure below is used to keep track of all of the interpereters
  591. ***************
  592. *** 76,84 ****
  593.                   int flags));
  594.   static int        FindVariable _ANSI_ARGS_((CONST char *name,
  595.                   int *lengthPtr));
  596. ! void            setenv _ANSI_ARGS_((CONST char *name,
  597.                   CONST char *value));
  598. ! void            unsetenv _ANSI_ARGS_((CONST char *name));
  599.   
  600.   /*
  601.    *----------------------------------------------------------------------
  602. --- 78,86 ----
  603.                   int flags));
  604.   static int        FindVariable _ANSI_ARGS_((CONST char *name,
  605.                   int *lengthPtr));
  606. ! void            TclSetEnv _ANSI_ARGS_((CONST char *name,
  607.                   CONST char *value));
  608. ! void            TclUnsetEnv _ANSI_ARGS_((CONST char *name));
  609.   
  610.   /*
  611.    *----------------------------------------------------------------------
  612. ***************
  613. *** 202,212 ****
  614.   /*
  615.    *----------------------------------------------------------------------
  616.    *
  617. !  * setenv --
  618.    *
  619.    *    Set an environment variable, replacing an existing value
  620.    *    or creating a new variable if there doesn't exist a variable
  621. !  *    by the given name.
  622.    *
  623.    * Results:
  624.    *    None.
  625. --- 204,217 ----
  626.   /*
  627.    *----------------------------------------------------------------------
  628.    *
  629. !  * TclSetEnv --
  630.    *
  631.    *    Set an environment variable, replacing an existing value
  632.    *    or creating a new variable if there doesn't exist a variable
  633. !  *    by the given name.  This procedure is intended to be a
  634. !  *    stand-in for the  UNIX "setenv" procedure so that applications
  635. !  *    using that procedure will interface properly to Tcl.  To make
  636. !  *    it a stand-in, the Makefile must define "TclSetEnv" to "setenv".
  637.    *
  638.    * Results:
  639.    *    None.
  640. ***************
  641. *** 219,225 ****
  642.    */
  643.   
  644.   void
  645. ! setenv(name, value)
  646.       CONST char *name;        /* Name of variable whose value is to be
  647.                    * set. */
  648.       CONST char *value;        /* New value for variable. */
  649. --- 224,230 ----
  650.    */
  651.   
  652.   void
  653. ! TclSetEnv(name, value)
  654.       CONST char *name;        /* Name of variable whose value is to be
  655.                    * set. */
  656.       CONST char *value;        /* New value for variable. */
  657. ***************
  658. *** 294,307 ****
  659.   /*
  660.    *----------------------------------------------------------------------
  661.    *
  662. !  * putenv --
  663.    *
  664.    *    Set an environment variable.  Similar to setenv except that
  665.    *    the information is passed in a single string of the form
  666.    *    NAME=value, rather than as separate name strings.  This procedure
  667. !  *    is a stand-in for the standard UNIX procedure by the same name,
  668.    *    so that applications using that procedure will interface
  669. !  *    properly to Tcl.
  670.    *
  671.    * Results:
  672.    *    None.
  673. --- 299,313 ----
  674.   /*
  675.    *----------------------------------------------------------------------
  676.    *
  677. !  * Tcl_PutEnv --
  678.    *
  679.    *    Set an environment variable.  Similar to setenv except that
  680.    *    the information is passed in a single string of the form
  681.    *    NAME=value, rather than as separate name strings.  This procedure
  682. !  *    is intended to be a stand-in for the  UNIX "putenv" procedure
  683.    *    so that applications using that procedure will interface
  684. !  *    properly to Tcl.  To make it a stand-in, the Makefile will
  685. !  *    define "Tcl_PutEnv" to "putenv".
  686.    *
  687.    * Results:
  688.    *    None.
  689. ***************
  690. *** 314,320 ****
  691.    */
  692.   
  693.   int
  694. ! putenv(string)
  695.       CONST char *string;        /* Info about environment variable in the
  696.                    * form NAME=value. */
  697.   {
  698. --- 320,326 ----
  699.    */
  700.   
  701.   int
  702. ! Tcl_PutEnv(string)
  703.       CONST char *string;        /* Info about environment variable in the
  704.                    * form NAME=value. */
  705.   {
  706. ***************
  707. *** 327,333 ****
  708.   
  709.       /*
  710.        * Separate the string into name and value parts, then call
  711. !      * setenv to do all of the real work.
  712.        */
  713.   
  714.       value = strchr(string, '=');
  715. --- 333,339 ----
  716.   
  717.       /*
  718.        * Separate the string into name and value parts, then call
  719. !      * TclSetEnv to do all of the real work.
  720.        */
  721.   
  722.       value = strchr(string, '=');
  723. ***************
  724. *** 341,347 ****
  725.       name = ckalloc((unsigned) nameLength+1);
  726.       memcpy(name, string, nameLength);
  727.       name[nameLength] = 0;
  728. !     setenv(name, value+1);
  729.       ckfree(name);
  730.       return 0;
  731.   }
  732. --- 347,353 ----
  733.       name = ckalloc((unsigned) nameLength+1);
  734.       memcpy(name, string, nameLength);
  735.       name[nameLength] = 0;
  736. !     TclSetEnv(name, value+1);
  737.       ckfree(name);
  738.       return 0;
  739.   }
  740. ***************
  741. *** 349,358 ****
  742.   /*
  743.    *----------------------------------------------------------------------
  744.    *
  745. !  * unsetenv --
  746.    *
  747.    *    Remove an environment variable, updating the "env" arrays
  748. !  *    in all interpreters managed by us.
  749.    *
  750.    * Results:
  751.    *    None.
  752. --- 355,367 ----
  753.   /*
  754.    *----------------------------------------------------------------------
  755.    *
  756. !  * TclUnsetEnv --
  757.    *
  758.    *    Remove an environment variable, updating the "env" arrays
  759. !  *    in all interpreters managed by us.  This function is intended
  760. !  *    to replace the UNIX "unsetenv" function (but to do this the
  761. !  *    Makefile must be modified to redefine "TclUnsetEnv" to
  762. !  *    "unsetenv".
  763.    *
  764.    * Results:
  765.    *    None.
  766. ***************
  767. *** 364,370 ****
  768.    */
  769.   
  770.   void
  771. ! unsetenv(name)
  772.       CONST char *name;            /* Name of variable to remove. */
  773.   {
  774.       int index, dummy;
  775. --- 373,379 ----
  776.    */
  777.   
  778.   void
  779. ! TclUnsetEnv(name)
  780.       CONST char *name;            /* Name of variable to remove. */
  781.   {
  782.       int index, dummy;
  783. ***************
  784. *** 466,480 ****
  785.       }
  786.   
  787.       /*
  788. !      * If a value is being set, call setenv to do all of the work.
  789.        */
  790.   
  791.       if (flags & TCL_TRACE_WRITES) {
  792. !     setenv(name2, Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY));
  793.       }
  794.   
  795.       if (flags & TCL_TRACE_UNSETS) {
  796. !     unsetenv(name2);
  797.       }
  798.       return NULL;
  799.   }
  800. --- 475,489 ----
  801.       }
  802.   
  803.       /*
  804. !      * If a value is being set, call TclSetEnv to do all of the work.
  805.        */
  806.   
  807.       if (flags & TCL_TRACE_WRITES) {
  808. !     TclSetEnv(name2, Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY));
  809.       }
  810.   
  811.       if (flags & TCL_TRACE_UNSETS) {
  812. !     TclUnsetEnv(name2);
  813.       }
  814.       return NULL;
  815.   }
  816. *** ../tcl7.0b1/./tclMtherr.c    Thu Jun  3 10:36:37 1993
  817. --- ./tclMtherr.c    Mon Jul 19 15:21:09 1993
  818. ***************
  819. *** 26,38 ****
  820.    */
  821.   
  822.   #ifndef lint
  823. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclMtherr.c,v 1.3 93/06/03 10:36:22 ouster Exp $ SPRITE (Berkeley)";
  824.   #endif /* not lint */
  825.   
  826.   #include "tclInt.h"
  827. - #ifndef TCL_NO_MATH
  828.   #include <math.h>
  829. - #endif
  830.   
  831.   /*
  832.    * The stuff below is a bit of a hack so that this file can be used
  833. --- 26,36 ----
  834.    */
  835.   
  836.   #ifndef lint
  837. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclMtherr.c,v 1.4 93/07/19 14:58:45 ouster Exp $ SPRITE (Berkeley)";
  838.   #endif /* not lint */
  839.   
  840.   #include "tclInt.h"
  841.   #include <math.h>
  842.   
  843.   /*
  844.    * The stuff below is a bit of a hack so that this file can be used
  845. ***************
  846. *** 57,76 ****
  847.   
  848.   extern int tcl_MathInProgress;
  849.   
  850. - /*
  851. -  * Define a dummy "struct exception" structure if none already exists.
  852. -  * The "OVERFLOW" #define is tested to see whether matherr stuff has
  853. -  * been defined in math.h (struct exception is only defined if the
  854. -  * matherr stuff is defined).
  855. -  */
  856. - #ifndef OVERFLOW
  857. - struct exception {
  858. -     int type;
  859. - };
  860. - #define DOMAIN 0
  861. - #define SING 1
  862. - #endif
  863.   
  864.   /*
  865.    *----------------------------------------------------------------------
  866. --- 55,60 ----
  867. *** ../tcl7.0b1/./tclCmdAH.c    Thu Jun 17 15:23:35 1993
  868. --- ./tclCmdAH.c    Sat Jul 17 15:25:38 1993
  869. ***************
  870. *** 27,33 ****
  871.    */
  872.   
  873.   #ifndef lint
  874. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclCmdAH.c,v 1.89 93/06/17 11:23:06 ouster Exp $ SPRITE (Berkeley)";
  875.   #endif
  876.   
  877.   #include "tclInt.h"
  878. --- 27,33 ----
  879.    */
  880.   
  881.   #ifndef lint
  882. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclCmdAH.c,v 1.90 93/07/17 15:25:20 ouster Exp $ SPRITE (Berkeley)";
  883.   #endif
  884.   
  885.   #include "tclInt.h"
  886. ***************
  887. *** 835,851 ****
  888.           goto badIndex;
  889.       }
  890.       switch (*format) {
  891. !         case 'D':
  892. !         case 'O':
  893. !         case 'U':
  894. !         if (!useShort) {
  895. !             newPtr++;
  896. !         } else {
  897. !             useShort = 0;
  898. !         }
  899. !         newPtr[-1] = tolower(*format);
  900. !         newPtr[-2] = 'l';
  901. !         *newPtr = 0;
  902.           case 'd':
  903.           case 'o':
  904.           case 'u':
  905. --- 835,842 ----
  906.           goto badIndex;
  907.       }
  908.       switch (*format) {
  909. !         case 'i':
  910. !         newPtr[-1] = 'd';
  911.           case 'd':
  912.           case 'o':
  913.           case 'u':
  914. ***************
  915. *** 868,875 ****
  916.           }
  917.           size = 1;
  918.           break;
  919. -         case 'F':
  920. -         newPtr[-1] = tolower(newPtr[-1]);
  921.           case 'e':
  922.           case 'E':
  923.           case 'f':
  924. --- 859,864 ----
  925. *** ../tcl7.0b1/./tclCmdMZ.c    Thu Jun 17 13:33:35 1993
  926. --- ./tclCmdMZ.c    Fri Jul 16 16:51:35 1993
  927. ***************
  928. *** 28,34 ****
  929.    */
  930.   
  931.   #ifndef lint
  932. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclCmdMZ.c,v 1.32 93/06/17 13:33:28 ouster Exp $ SPRITE (Berkeley)";
  933.   #endif
  934.   
  935.   #include "tclInt.h"
  936. --- 28,34 ----
  937.    */
  938.   
  939.   #ifndef lint
  940. ! static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclCmdMZ.c,v 1.34 93/07/16 16:50:50 ouster Exp $ SPRITE (Berkeley)";
  941.   #endif
  942.   
  943.   #include "tclInt.h"
  944. ***************
  945. *** 536,565 ****
  946.       char **argv;            /* Argument strings. */
  947.   {
  948.       Interp *iPtr = (Interp *) interp;
  949. !     int c;
  950.   
  951. !     if (argc > 3) {
  952.       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  953. !         " ?value? ?code?\"", (char *) NULL);
  954.       return TCL_ERROR;
  955.       }
  956. !     if (argc >= 2) {
  957. !     Tcl_SetResult(interp, argv[1], TCL_VOLATILE);
  958. !     }
  959. !     iPtr->returnCode = TCL_OK;
  960. !     if (argc == 3) {
  961.       c = argv[2][0];
  962.       if ((c == 'o') && (strcmp(argv[2], "ok") == 0)) {
  963. !         iPtr->returnCode = TCL_OK;
  964.       } else if ((c == 'e') && (strcmp(argv[2], "error") == 0)) {
  965. !         iPtr->returnCode = TCL_ERROR;
  966.       } else if ((c == 'r') && (strcmp(argv[2], "return") == 0)) {
  967. !         iPtr->returnCode = TCL_RETURN;
  968.       } else if ((c == 'b') && (strcmp(argv[2], "break") == 0)) {
  969. !         iPtr->returnCode = TCL_BREAK;
  970.       } else if ((c == 'c') && (strcmp(argv[2], "continue") == 0)) {
  971. !         iPtr->returnCode = TCL_CONTINUE;
  972. !     } else if (Tcl_GetInt(interp, argv[2], &iPtr->returnCode) != TCL_OK) {
  973.           Tcl_ResetResult(interp);
  974.           Tcl_AppendResult(interp, "bad completion code \"",
  975.               argv[2], "\": must be ok, error, return, break, ",
  976. --- 536,566 ----
  977.       char **argv;            /* Argument strings. */
  978.   {
  979.       Interp *iPtr = (Interp *) interp;
  980. !     int c, code;
  981.   
  982. !     if (argc > 4) {
  983. !     syntaxError:
  984.       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  985. !         " ?-code code? ?string?\"", (char *) NULL);
  986.       return TCL_ERROR;
  987.       }
  988. !     code = TCL_OK;
  989. !     if (argc >= 3) {
  990. !     if (strcmp(argv[1], "-code") != 0) {
  991. !         goto syntaxError;
  992. !     }
  993.       c = argv[2][0];
  994.       if ((c == 'o') && (strcmp(argv[2], "ok") == 0)) {
  995. !         code = TCL_OK;
  996.       } else if ((c == 'e') && (strcmp(argv[2], "error") == 0)) {
  997. !         code = TCL_ERROR;
  998.       } else if ((c == 'r') && (strcmp(argv[2], "return") == 0)) {
  999. !         code = TCL_RETURN;
  1000.       } else if ((c == 'b') && (strcmp(argv[2], "break") == 0)) {
  1001. !         code = TCL_BREAK;
  1002.       } else if ((c == 'c') && (strcmp(argv[2], "continue") == 0)) {
  1003. !         code = TCL_CONTINUE;
  1004. !     } else if (Tcl_GetInt(interp, argv[2], &code) != TCL_OK) {
  1005.           Tcl_ResetResult(interp);
  1006.           Tcl_AppendResult(interp, "bad completion code \"",
  1007.               argv[2], "\": must be ok, error, return, break, ",
  1008. ***************
  1009. *** 566,573 ****
  1010.               "continue, or an integer", (char *) NULL);
  1011.           return TCL_ERROR;
  1012.       }
  1013.       }
  1014.       return TCL_RETURN;
  1015.   }
  1016.   
  1017. --- 567,579 ----
  1018.               "continue, or an integer", (char *) NULL);
  1019.           return TCL_ERROR;
  1020.       }
  1021. +     if (argc == 4) {
  1022. +         Tcl_SetResult(interp, argv[3], TCL_VOLATILE);
  1023. +     }
  1024. +     } else if (argc == 2) {
  1025. +     Tcl_SetResult(interp, argv[1], TCL_VOLATILE);
  1026.       }
  1027. !     iPtr->returnCode = code;
  1028.       return TCL_RETURN;
  1029.   }
  1030.   
  1031. ***************
  1032. *** 615,625 ****
  1033.                        * suppressed. */
  1034.       int totalSize = 0;            /* Number of bytes needed to store
  1035.                        * all results combined. */
  1036. !     char *results;            /* Where scanned output goes.  */
  1037.       int numScanned;            /* sscanf's result. */
  1038.       register char *fmt;
  1039. !     int i, widthSpecified;
  1040.   
  1041.       if (argc < 3) {
  1042.       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1043.           " string format ?varName varName ...?\"", (char *) NULL);
  1044. --- 621,643 ----
  1045.                        * suppressed. */
  1046.       int totalSize = 0;            /* Number of bytes needed to store
  1047.                        * all results combined. */
  1048. !     char *results;            /* Where scanned output goes.
  1049. !                      * Malloced; NULL means not allocated
  1050. !                      * yet. */
  1051.       int numScanned;            /* sscanf's result. */
  1052.       register char *fmt;
  1053. !     int i, widthSpecified, length, code;
  1054. !     /*
  1055. !      * The variables below are used to hold a copy of the format
  1056. !      * string, so that we can replace format specifiers like "%f"
  1057. !      * and "%F" with specifiers like "%lf"
  1058. !      */
  1059.   
  1060. + #   define STATIC_SIZE 5
  1061. +     char copyBuf[STATIC_SIZE], *fmtCopy;
  1062. +     register char *dst;
  1063.       if (argc < 3) {
  1064.       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1065.           " string format ?varName varName ...?\"", (char *) NULL);
  1066. ***************
  1067. *** 635,651 ****
  1068. --- 653,684 ----
  1069.        * 4. Pick off the fields from the array and assign them to variables.
  1070.        */
  1071.   
  1072. +     code = TCL_OK;
  1073. +     results = NULL;
  1074.       arg1Length = (strlen(argv[1]) + 4) & ~03;
  1075. +     length = strlen(argv[2]) * 2 + 1;
  1076. +     if (length < STATIC_SIZE) {
  1077. +     fmtCopy = copyBuf;
  1078. +     } else {
  1079. +     fmtCopy = ckalloc((unsigned) length);
  1080. +     }
  1081. +     dst = fmtCopy;
  1082.       for (fmt = argv[2]; *fmt != 0; fmt++) {
  1083. +     *dst = *fmt;
  1084. +     dst++;
  1085.       if (*fmt != '%') {
  1086.           continue;
  1087.       }
  1088.       fmt++;
  1089.       if (*fmt == '%') {
  1090. +         *dst = *fmt;
  1091. +         dst++;
  1092.           continue;
  1093.       }
  1094.       if (*fmt == '*') {
  1095.           suppress = 1;
  1096. +         *dst = *fmt;
  1097. +         dst++;
  1098.           fmt++;
  1099.       } else {
  1100.           suppress = 0;
  1101. ***************
  1102. *** 653,674 ****
  1103.       widthSpecified = 0;
  1104.       while (isdigit(*fmt)) {
  1105.           widthSpecified = 1;
  1106.           fmt++;
  1107.       }
  1108.       if (suppress) {
  1109.           continue;
  1110.       }
  1111.       if (numFields == MAX_FIELDS) {
  1112.           interp->result = "too many fields to scan";
  1113. !         return TCL_ERROR;
  1114.       }
  1115.       curField = &fields[numFields];
  1116.       numFields++;
  1117.       switch (*fmt) {
  1118. -         case 'D':
  1119. -         case 'O':
  1120. -         case 'X':
  1121.           case 'd':
  1122.           case 'o':
  1123.           case 'x':
  1124.           curField->fmt = 'd';
  1125. --- 686,713 ----
  1126.       widthSpecified = 0;
  1127.       while (isdigit(*fmt)) {
  1128.           widthSpecified = 1;
  1129. +         *dst = *fmt;
  1130. +         dst++;
  1131. +         fmt++;
  1132. +     }
  1133. +     if ((*fmt == 'l') || (*fmt == 'h') || (*fmt == 'L')) {
  1134.           fmt++;
  1135.       }
  1136. +     *dst = *fmt;
  1137. +     dst++;
  1138.       if (suppress) {
  1139.           continue;
  1140.       }
  1141.       if (numFields == MAX_FIELDS) {
  1142.           interp->result = "too many fields to scan";
  1143. !         code = TCL_ERROR;
  1144. !         goto done;
  1145.       }
  1146.       curField = &fields[numFields];
  1147.       numFields++;
  1148.       switch (*fmt) {
  1149.           case 'd':
  1150. +         case 'i':
  1151.           case 'o':
  1152.           case 'x':
  1153.           curField->fmt = 'd';
  1154. ***************
  1155. *** 675,680 ****
  1156. --- 714,724 ----
  1157.           curField->size = sizeof(int);
  1158.           break;
  1159.   
  1160. +         case 'u':
  1161. +         curField->fmt = 'u';
  1162. +         curField->size = sizeof(int);
  1163. +         break;
  1164.           case 's':
  1165.           curField->fmt = 's';
  1166.           curField->size = arg1Length;
  1167. ***************
  1168. *** 684,705 ****
  1169.                   if (widthSpecified) {
  1170.                       interp->result = 
  1171.                            "field width may not be specified in %c conversion";
  1172. !                     return TCL_ERROR;
  1173.                   }
  1174.           curField->fmt = 'c';
  1175.           curField->size = sizeof(int);
  1176.           break;
  1177.   
  1178. -         case 'E':
  1179. -         case 'F':
  1180. -         curField->fmt = 'F';
  1181. -         curField->size = sizeof(double);
  1182. -         break;
  1183.           case 'e':
  1184.           case 'f':
  1185.           curField->fmt = 'f';
  1186. !         curField->size = sizeof(float);
  1187.           break;
  1188.   
  1189.           case '[':
  1190. --- 728,748 ----
  1191.                   if (widthSpecified) {
  1192.                       interp->result = 
  1193.                            "field width may not be specified in %c conversion";
  1194. !             code = TCL_ERROR;
  1195. !             goto done;
  1196.                   }
  1197.           curField->fmt = 'c';
  1198.           curField->size = sizeof(int);
  1199.           break;
  1200.   
  1201.           case 'e':
  1202.           case 'f':
  1203. +         case 'g':
  1204. +         dst[-1] = 'l';
  1205. +         dst[0] = 'f';
  1206. +         dst++;
  1207.           curField->fmt = 'f';
  1208. !         curField->size = sizeof(double);
  1209.           break;
  1210.   
  1211.           case '[':
  1212. ***************
  1213. *** 707,712 ****
  1214. --- 750,757 ----
  1215.           curField->size = arg1Length;
  1216.           do {
  1217.               fmt++;
  1218. +             *dst = *fmt;
  1219. +             dst++;
  1220.           } while (*fmt != ']');
  1221.           break;
  1222.   
  1223. ***************
  1224. *** 713,727 ****
  1225.           default:
  1226.           sprintf(interp->result, "bad scan conversion character \"%c\"",
  1227.               *fmt);
  1228. !         return TCL_ERROR;
  1229.       }
  1230.       totalSize += curField->size;
  1231.       }
  1232.   
  1233.       if (numFields != (argc-3)) {
  1234.       interp->result =
  1235.           "different numbers of variable names and field specifiers";
  1236. !     return TCL_ERROR;
  1237.       }
  1238.   
  1239.       /*
  1240. --- 758,775 ----
  1241.           default:
  1242.           sprintf(interp->result, "bad scan conversion character \"%c\"",
  1243.               *fmt);
  1244. !         code = TCL_ERROR;
  1245. !         goto done;
  1246.       }
  1247.       totalSize += curField->size;
  1248.       }
  1249. +     *dst = 0;
  1250.   
  1251.       if (numFields != (argc-3)) {
  1252.       interp->result =
  1253.           "different numbers of variable names and field specifiers";
  1254. !     code = TCL_ERROR;
  1255. !     goto done;
  1256.       }
  1257.   
  1258.       /*
  1259. ***************
  1260. *** 749,755 ****
  1261.        * Step 3:
  1262.        */
  1263.   
  1264. !     numScanned = sscanf(argv[1], argv[2],
  1265.           fields[0].location, fields[1].location, fields[2].location,
  1266.           fields[3].location, fields[4].location, fields[5].location,
  1267.           fields[6].location, fields[7].location, fields[8].location,
  1268. --- 797,803 ----
  1269.        * Step 3:
  1270.        */
  1271.   
  1272. !     numScanned = sscanf(argv[1], fmtCopy,
  1273.           fields[0].location, fields[1].location, fields[2].location,
  1274.           fields[3].location, fields[4].location, fields[5].location,
  1275.           fields[6].location, fields[7].location, fields[8].location,
  1276. ***************
  1277. *** 776,783 ****
  1278.               Tcl_AppendResult(interp,
  1279.                   "couldn't set variable \"", argv[i+3], "\"",
  1280.                   (char *) NULL);
  1281. !             ckfree((char *) results);
  1282. !             return TCL_ERROR;
  1283.           }
  1284.           break;
  1285.   
  1286. --- 824,838 ----
  1287.               Tcl_AppendResult(interp,
  1288.                   "couldn't set variable \"", argv[i+3], "\"",
  1289.                   (char *) NULL);
  1290. !             code = TCL_ERROR;
  1291. !             goto done;
  1292. !         }
  1293. !         break;
  1294. !         case 'u':
  1295. !         sprintf(string, "%u", *((int *) curField->location));
  1296. !         if (Tcl_SetVar(interp, argv[i+3], string, 0) == NULL) {
  1297. !             goto storeError;
  1298.           }
  1299.           break;
  1300.   
  1301. ***************
  1302. *** 795,810 ****
  1303.           }
  1304.           break;
  1305.   
  1306. -         case 'F':
  1307. -         Tcl_PrintDouble(interp, *((double *) curField->location),
  1308. -             string);
  1309. -         if (Tcl_SetVar(interp, argv[i+3], string, 0) == NULL) {
  1310. -             goto storeError;
  1311. -         }
  1312. -         break;
  1313.           case 'f':
  1314. !         Tcl_PrintDouble(interp, *((float *) curField->location),
  1315.               string);
  1316.           if (Tcl_SetVar(interp, argv[i+3], string, 0) == NULL) {
  1317.               goto storeError;
  1318. --- 850,857 ----
  1319.           }
  1320.           break;
  1321.   
  1322.           case 'f':
  1323. !         Tcl_PrintDouble(interp, *((double *) curField->location),
  1324.               string);
  1325.           if (Tcl_SetVar(interp, argv[i+3], string, 0) == NULL) {
  1326.               goto storeError;
  1327. ***************
  1328. *** 812,820 ****
  1329.           break;
  1330.       }
  1331.       }
  1332. -     ckfree(results);
  1333.       sprintf(interp->result, "%d", numScanned);
  1334. !     return TCL_OK;
  1335.   }
  1336.   
  1337.   /*
  1338. --- 859,873 ----
  1339.           break;
  1340.       }
  1341.       }
  1342.       sprintf(interp->result, "%d", numScanned);
  1343. !     done:
  1344. !     if (results != NULL) {
  1345. !     ckfree(results);
  1346. !     }
  1347. !     if (fmtCopy != copyBuf) {
  1348. !     ckfree(fmtCopy);
  1349. !     }
  1350. !     return code;
  1351.   }
  1352.   
  1353.   /*
  1354. *** ../tcl7.0b1/./tclCkalloc.c    Thu Jun  3 15:08:02 1993
  1355. --- ./tclCkalloc.c    Thu Jul 15 16:42:56 1993
  1356. ***************
  1357. *** 260,271 ****
  1358.       }
  1359.   
  1360.       /*
  1361. !      * Fill in guard zones and size.  Link into allocated list.
  1362.        */
  1363.       result->length = size;
  1364.       result->file = file;
  1365.       result->line = line;
  1366.       memset ((char *) result->low_guard, GUARD_VALUE, GUARD_SIZE);
  1367.       memset (result->body + size, GUARD_VALUE, GUARD_SIZE);
  1368.       result->flink = allocHead;
  1369.       result->blink = NULL;
  1370. --- 260,274 ----
  1371.       }
  1372.   
  1373.       /*
  1374. !      * Fill in guard zones and size.  Also initialize the contents of
  1375. !      * the block with bogus bytes to detect uses of initialized data.
  1376. !      * Link into allocated list.
  1377.        */
  1378.       result->length = size;
  1379.       result->file = file;
  1380.       result->line = line;
  1381.       memset ((char *) result->low_guard, GUARD_VALUE, GUARD_SIZE);
  1382. +     memset (result->body, GUARD_VALUE, size);
  1383.       memset (result->body + size, GUARD_VALUE, GUARD_SIZE);
  1384.       result->flink = allocHead;
  1385.       result->blink = NULL;
  1386. *** ../tcl7.0b1/./tcl.h    Wed Jul  7 16:24:42 1993
  1387. --- ./tcl.h    Mon Jul 19 16:07:29 1993
  1388. ***************
  1389. *** 24,30 ****
  1390.    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  1391.    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1392.    *
  1393. !  * $Header: /user6/ouster/tcl/RCS/tcl.h,v 1.116 93/07/07 16:24:40 ouster Exp $ SPRITE (Berkeley)
  1394.    */
  1395.   
  1396.   #ifndef _TCL
  1397. --- 24,30 ----
  1398.    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  1399.    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1400.    *
  1401. !  * $Header: /user6/ouster/tcl/RCS/tcl.h,v 1.117 93/07/19 08:47:25 ouster Exp $ SPRITE (Berkeley)
  1402.    */
  1403.   
  1404.   #ifndef _TCL
  1405. ***************
  1406. *** 88,94 ****
  1407.   #endif
  1408.   
  1409.   #ifndef _CLIENTDATA
  1410. ! typedef int *ClientData;
  1411.   #define _CLIENTDATA
  1412.   #endif
  1413.   
  1414. --- 88,98 ----
  1415.   #endif
  1416.   
  1417.   #ifndef _CLIENTDATA
  1418. ! #   ifdef __STDC__
  1419. !     typedef void *ClientData;
  1420. ! #   else
  1421. !     typedef int *ClientData;
  1422. ! #   endif /* __STDC__ */
  1423.   #define _CLIENTDATA
  1424.   #endif
  1425.   
  1426. *** ../tcl7.0b1/./tclUnix.h    Thu Jul  8 09:59:27 1993
  1427. --- ./tclUnix.h    Mon Jul 19 16:08:14 1993
  1428. ***************
  1429. *** 31,37 ****
  1430.    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  1431.    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1432.    *
  1433. !  * $Header: /user6/ouster/tcl/RCS/tclUnix.h,v 1.41 93/07/08 09:59:26 ouster Exp $ SPRITE (Berkeley)
  1434.    */
  1435.   
  1436.   #ifndef _TCLUNIX
  1437. --- 31,37 ----
  1438.    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  1439.    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  1440.    *
  1441. !  * $Header: /user6/ouster/tcl/RCS/tclUnix.h,v 1.43 93/07/19 16:08:04 ouster Exp $ SPRITE (Berkeley)
  1442.    */
  1443.   
  1444.   #ifndef _TCLUNIX
  1445. ***************
  1446. *** 62,71 ****
  1447.   #ifndef NO_SYS_WAIT_H
  1448.   #   include <sys/wait.h>
  1449.   #endif
  1450. ! #ifndef HAVE_UNISTD
  1451.   #   include <unistd.h>
  1452.   #else
  1453. ! #   include <compat/unistd.h>
  1454.   #endif
  1455.   
  1456.   /*
  1457. --- 62,71 ----
  1458.   #ifndef NO_SYS_WAIT_H
  1459.   #   include <sys/wait.h>
  1460.   #endif
  1461. ! #ifdef HAVE_UNISTD_H
  1462.   #   include <unistd.h>
  1463.   #else
  1464. ! #   include "compat/unistd.h"
  1465.   #endif
  1466.   
  1467.   /*
  1468. *** ../tcl7.0b1/./configure    Thu Jun 17 15:52:16 1993
  1469. --- ./configure    Mon Jul 19 15:22:46 1993
  1470. ***************
  1471. *** 1,4 ****
  1472.   #!/bin/sh
  1473.   # Guess values for system-dependent variables and create Makefiles.
  1474.   # Generated automatically using autoconf.
  1475. --- 1,3 ----
  1476. ***************
  1477. *** 158,163 ****
  1478. --- 157,166 ----
  1479.   test -z "$RANLIB" && RANLIB="@:"
  1480.   
  1481.   
  1482. + #--------------------------------------------------------------------
  1483. + #    Supply substitutes for missing POSIX library procedures, or
  1484. + #    set flags so Tcl uses alternate procedures.
  1485. + #--------------------------------------------------------------------
  1486.   
  1487.   for func in getcwd opendir strerror strstr strtod
  1488.   do
  1489. ***************
  1490. *** 261,267 ****
  1491.   #endif
  1492.   
  1493.   
  1494.   
  1495.   echo checking for unistd.h
  1496.   echo checking how to run the C preprocessor
  1497. --- 264,278 ----
  1498.   #endif
  1499.   
  1500.   
  1501. ! #--------------------------------------------------------------------
  1502. ! #    Supply substitutes for missing POSIX header files.  Special
  1503. ! #    notes:
  1504. ! #        - Sprite's dirent.h exists but is bogus.
  1505. ! #        - stdlib.h doesn't define strtol, strtoul, or
  1506. ! #          strtod insome versions of SunOS
  1507. ! #        - some versions of string.h don't declare procedures such
  1508. ! #          as strstr
  1509. ! #--------------------------------------------------------------------
  1510.   
  1511.   echo checking for unistd.h
  1512.   echo checking how to run the C preprocessor
  1513. ***************
  1514. *** 304,316 ****
  1515.    }
  1516.   EOF
  1517.   if eval $compile; then
  1518. !   :
  1519.   else
  1520. !   DEFS="$DEFS -DNO_DIRENT_H=1"
  1521.   fi
  1522.   rm -f conftest*
  1523.   
  1524. ! echo '#include <DEFS="$DEFS -DNO_DIRENT_H=1">' > conftest.c
  1525.   eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  1526.   if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
  1527.     :
  1528. --- 315,327 ----
  1529.    }
  1530.   EOF
  1531.   if eval $compile; then
  1532. !   tcl_ok=1
  1533.   else
  1534. !   tcl_ok=0
  1535.   fi
  1536.   rm -f conftest*
  1537.   
  1538. ! echo '#include <tcl_ok=0>' > conftest.c
  1539.   eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  1540.   if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
  1541.     :
  1542. ***************
  1543. *** 317,322 ****
  1544. --- 328,334 ----
  1545.   fi
  1546.   rm -f conftest*
  1547.   
  1548. + if test $tcl_ok = 0; then DEFS="$DEFS -DNO_DIRENT_H=1"; fi
  1549.   echo checking for float.h
  1550.   cat > conftest.c <<EOF
  1551.   #include <float.h>
  1552. ***************
  1553. *** 347,355 ****
  1554.   EOF
  1555.   err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  1556.   if test -z "$err"; then
  1557. !   :
  1558.   else
  1559. !   DEFS="$DEFS -DNO_STDLIB_H=1"
  1560.   fi
  1561.   rm -f conftest*
  1562.   
  1563. --- 359,367 ----
  1564.   EOF
  1565.   err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  1566.   if test -z "$err"; then
  1567. !   tcl_ok=1
  1568.   else
  1569. !   tcl_ok=0
  1570.   fi
  1571.   rm -f conftest*
  1572.   
  1573. ***************
  1574. *** 358,364 ****
  1575.   if egrep "strtol" conftest.out >/dev/null 2>&1; then
  1576.     :
  1577.   else 
  1578. !   DEFS="$DEFS -DNO_STDLIB_H=1"
  1579.   fi
  1580.   rm -f conftest*
  1581.   
  1582. --- 370,376 ----
  1583.   if egrep "strtol" conftest.out >/dev/null 2>&1; then
  1584.     :
  1585.   else 
  1586. !   tcl_ok=0
  1587.   fi
  1588.   rm -f conftest*
  1589.   
  1590. ***************
  1591. *** 367,373 ****
  1592.   if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  1593.     :
  1594.   else 
  1595. !   DEFS="$DEFS -DNO_STDLIB_H=1"
  1596.   fi
  1597.   rm -f conftest*
  1598.   
  1599. --- 379,385 ----
  1600.   if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  1601.     :
  1602.   else 
  1603. !   tcl_ok=0
  1604.   fi
  1605.   rm -f conftest*
  1606.   
  1607. ***************
  1608. *** 376,385 ****
  1609.   if egrep "strtod" conftest.out >/dev/null 2>&1; then
  1610.     :
  1611.   else 
  1612. !   DEFS="$DEFS -DNO_STDLIB_H=1"
  1613.   fi
  1614.   rm -f conftest*
  1615.   
  1616.   echo checking for string.h
  1617.   cat > conftest.c <<EOF
  1618.   #include <string.h>
  1619. --- 388,398 ----
  1620.   if egrep "strtod" conftest.out >/dev/null 2>&1; then
  1621.     :
  1622.   else 
  1623. !   tcl_ok=0
  1624.   fi
  1625.   rm -f conftest*
  1626.   
  1627. + if test $tcl_ok = 0; then DEFS="$DEFS -DNO_STDLIB_H=1"; fi
  1628.   echo checking for string.h
  1629.   cat > conftest.c <<EOF
  1630.   #include <string.h>
  1631. ***************
  1632. *** 386,394 ****
  1633.   EOF
  1634.   err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  1635.   if test -z "$err"; then
  1636. !   :
  1637.   else
  1638. !   DEFS="$DEFS -DNO_STRING_H=1"
  1639.   fi
  1640.   rm -f conftest*
  1641.   
  1642. --- 399,407 ----
  1643.   EOF
  1644.   err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  1645.   if test -z "$err"; then
  1646. !   tcl_ok=1
  1647.   else
  1648. !   tcl_ok=0
  1649.   fi
  1650.   rm -f conftest*
  1651.   
  1652. ***************
  1653. *** 397,403 ****
  1654.   if egrep "strstr" conftest.out >/dev/null 2>&1; then
  1655.     :
  1656.   else 
  1657. !   DEFS="$DEFS -DNO_STRING_H=1"
  1658.   fi
  1659.   rm -f conftest*
  1660.   
  1661. --- 410,416 ----
  1662.   if egrep "strstr" conftest.out >/dev/null 2>&1; then
  1663.     :
  1664.   else 
  1665. !   tcl_ok=0
  1666.   fi
  1667.   rm -f conftest*
  1668.   
  1669. ***************
  1670. *** 406,415 ****
  1671.   if egrep "strerror" conftest.out >/dev/null 2>&1; then
  1672.     :
  1673.   else 
  1674. !   DEFS="$DEFS -DNO_STRING_H=1"
  1675.   fi
  1676.   rm -f conftest*
  1677.   
  1678.   echo checking for sys/time.h
  1679.   cat > conftest.c <<EOF
  1680.   #include <sys/time.h>
  1681. --- 419,429 ----
  1682.   if egrep "strerror" conftest.out >/dev/null 2>&1; then
  1683.     :
  1684.   else 
  1685. !   tcl_ok=0
  1686.   fi
  1687.   rm -f conftest*
  1688.   
  1689. + if test $tcl_ok = 0; then DEFS="$DEFS -DNO_STRING_H=1"; fi
  1690.   echo checking for sys/time.h
  1691.   cat > conftest.c <<EOF
  1692.   #include <sys/time.h>
  1693. ***************
  1694. *** 435,440 ****
  1695. --- 449,458 ----
  1696.   rm -f conftest*
  1697.   
  1698.   
  1699. + #--------------------------------------------------------------------
  1700. + #    On some systems strstr is broken: it returns a pointer even
  1701. + #    even if the original string is empty.
  1702. + #--------------------------------------------------------------------
  1703.   
  1704.   cat > conftest.c <<EOF
  1705.   
  1706. ***************
  1707. *** 453,458 ****
  1708. --- 471,480 ----
  1709.   fi
  1710.   rm -f conftest*
  1711.   
  1712. + #--------------------------------------------------------------------
  1713. + #    Under some versions of AIX strtoul returns an incorrect terminator
  1714. + #    pointer for the string "0".
  1715. + #--------------------------------------------------------------------
  1716.   
  1717.   cat > conftest.c <<EOF
  1718.   
  1719. ***************
  1720. *** 477,482 ****
  1721. --- 499,518 ----
  1722.   fi
  1723.   rm -f conftest*
  1724.   
  1725. + #--------------------------------------------------------------------
  1726. + #    Check for various typedefs and provide substitutes if
  1727. + #    they don't exist.
  1728. + #--------------------------------------------------------------------
  1729. + echo checking for mode_t in sys/types.h
  1730. + echo '#include <sys/types.h>' > conftest.c
  1731. + eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  1732. + if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  1733. +   :
  1734. + else 
  1735. +   DEFS="$DEFS -Dmode_t=int"
  1736. + fi
  1737. + rm -f conftest*
  1738.   
  1739.   echo checking for pid_t in sys/types.h
  1740.   echo '#include <sys/types.h>' > conftest.c
  1741. ***************
  1742. *** 488,493 ****
  1743. --- 524,539 ----
  1744.   fi
  1745.   rm -f conftest*
  1746.   
  1747. + echo checking for size_t in sys/types.h
  1748. + echo '#include <sys/types.h>' > conftest.c
  1749. + eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  1750. + if egrep "size_t" conftest.out >/dev/null 2>&1; then
  1751. +   :
  1752. + else 
  1753. +   DEFS="$DEFS -Dsize_t=unsigned"
  1754. + fi
  1755. + rm -f conftest*
  1756.   echo checking for uid_t in sys/types.h
  1757.   echo '#include <sys/types.h>' > conftest.c
  1758.   eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  1759. ***************
  1760. *** 499,504 ****
  1761. --- 545,556 ----
  1762.   rm -f conftest*
  1763.   
  1764.   
  1765. + #--------------------------------------------------------------------
  1766. + #    If a system doesn't have an opendir function (man, that's old!)
  1767. + #    then we have to supply a different version of dirent.h which
  1768. + #    is compatible with the substitute version of opendir that's
  1769. + #    provided.  This version only works with V7-style directories.
  1770. + #--------------------------------------------------------------------
  1771.   
  1772.   echo checking for opendir
  1773.   cat > conftest.c <<EOF
  1774. ***************
  1775. *** 522,527 ****
  1776. --- 574,584 ----
  1777.   #endif
  1778.   
  1779.   
  1780. + #--------------------------------------------------------------------
  1781. + #    Check for the existence of sys_errlist (this is only needed if
  1782. + #    there's no strerror, but I don't know how to conditionalize the
  1783. + #    check).
  1784. + #--------------------------------------------------------------------
  1785.   
  1786.   echo checking for sys_errlist
  1787.   cat > conftest.c <<EOF
  1788. ***************
  1789. *** 541,546 ****
  1790. --- 598,610 ----
  1791.   rm -f conftest*
  1792.   
  1793.   
  1794. + #--------------------------------------------------------------------
  1795. + #    The check below checks whether <sys/wait.h> defines the type
  1796. + #    "union wait" correctly.  It's needed because of weirdness in
  1797. + #    HP-UX where "union wait" is defined in both the BSD and SYS-V
  1798. + #    environments.  Checking the usability of WIFEXITED seems to do
  1799. + #    the trick.
  1800. + #--------------------------------------------------------------------
  1801.   
  1802.   echo checking for union wait
  1803.   cat > conftest.c <<EOF
  1804. ***************
  1805. *** 561,576 ****
  1806.   rm -f conftest*
  1807.   
  1808.   
  1809.   
  1810. ! newDefs=""
  1811. ! for i in $DEFS; do
  1812. !     if test -z "$newDefs"; then
  1813. !         newDefs=$i
  1814. !     elif echo $newDefs | fgrep -v -e $i >/dev/null 2>&1; then
  1815. !         newDefs="$newDefs $i"
  1816. !     fi
  1817. ! done
  1818. ! DEFS=$newDefs
  1819.   
  1820.   if test -n "$prefix"; then
  1821.     test -z "$exec_prefix" && exec_prefix='${prefix}'
  1822. --- 625,650 ----
  1823.   rm -f conftest*
  1824.   
  1825.   
  1826. + #--------------------------------------------------------------------
  1827. + #    Check to see whether the system supports the matherr function
  1828. + #    and its associated type "struct exception".
  1829. + #--------------------------------------------------------------------
  1830.   
  1831. ! echo checking for matherr support
  1832. ! cat > conftest.c <<EOF
  1833. ! #include <math.h>
  1834. ! main() { exit(0); } 
  1835. ! t() { 
  1836. ! struct exception x;
  1837. ! x.type = DOMAIN;
  1838. ! x.type = SING;
  1839. !  }
  1840. ! EOF
  1841. ! if eval $compile; then
  1842. !   LIBOBJS="$LIBOBJS tclMtherr.o"; DEFS="$DEFS -DNEED_MATHERR=1"
  1843. ! fi
  1844. ! rm -f conftest*
  1845.   
  1846.   if test -n "$prefix"; then
  1847.     test -z "$exec_prefix" && exec_prefix='${prefix}'
  1848. *** ../tcl7.0b1/./configure.in    Thu Jun  3 15:39:17 1993
  1849. --- ./configure.in    Mon Jul 19 15:21:41 1993
  1850. ***************
  1851. *** 1,15 ****
  1852.   dnl    This file is an input file used by the GNU "autoconf" program to
  1853.   dnl    generate the file "configure", which is run during Tcl installation
  1854.   dnl    to configure the system for the local environment.
  1855.   AC_INIT(tcl.h)
  1856.   AC_PROG_INSTALL
  1857.   AC_PROG_RANLIB
  1858.   
  1859. ! dnl--------------------------------------------------------------------
  1860. ! dnl    Supply substitutes for missing POSIX library procedures, or set
  1861. ! dnl    flags so Tcl uses alternate procedures.
  1862. ! dnl--------------------------------------------------------------------
  1863.   
  1864.   AC_REPLACE_FUNCS(getcwd opendir strerror strstr strtod)
  1865.   AC_REPLACE_FUNCS(strtol strtoul tmpnam waitpid)
  1866. --- 1,14 ----
  1867.   dnl    This file is an input file used by the GNU "autoconf" program to
  1868.   dnl    generate the file "configure", which is run during Tcl installation
  1869.   dnl    to configure the system for the local environment.
  1870.   AC_INIT(tcl.h)
  1871.   AC_PROG_INSTALL
  1872.   AC_PROG_RANLIB
  1873.   
  1874. ! #--------------------------------------------------------------------
  1875. ! #    Supply substitutes for missing POSIX library procedures, or
  1876. ! #    set flags so Tcl uses alternate procedures.
  1877. ! #--------------------------------------------------------------------
  1878.   
  1879.   AC_REPLACE_FUNCS(getcwd opendir strerror strstr strtod)
  1880.   AC_REPLACE_FUNCS(strtol strtoul tmpnam waitpid)
  1881. ***************
  1882. *** 17,32 ****
  1883.   AC_FUNC_CHECK(getwd, , AC_DEFINE(NO_GETWD))
  1884.   AC_FUNC_CHECK(wait3, , AC_DEFINE(NO_WAIT3))
  1885.   
  1886. ! dnl--------------------------------------------------------------------
  1887. ! dnl    Supply substitutes for missing POSIX header files.  Special
  1888. ! dnl    notes:
  1889. ! dnl        - Sprite's dirent.h exists but is bogus.
  1890. ! dnl        - stdlib.h doesn't define strtol, strtoul, or
  1891. ! dnl          strtod insome versions of SunOS
  1892. ! dnl        - some versions of string.h don't declare procedures such
  1893. ! dnl          as strstr
  1894. ! dnl--------------------------------------------------------------------
  1895.   
  1896.   AC_UNISTD_H
  1897.   AC_COMPILE_CHECK(dirent.h, [#include <sys/types.h>
  1898. --- 16,30 ----
  1899.   AC_FUNC_CHECK(getwd, , AC_DEFINE(NO_GETWD))
  1900.   AC_FUNC_CHECK(wait3, , AC_DEFINE(NO_WAIT3))
  1901.   
  1902. ! #--------------------------------------------------------------------
  1903. ! #    Supply substitutes for missing POSIX header files.  Special
  1904. ! #    notes:
  1905. ! #        - Sprite's dirent.h exists but is bogus.
  1906. ! #        - stdlib.h doesn't define strtol, strtoul, or
  1907. ! #          strtod insome versions of SunOS
  1908. ! #        - some versions of string.h don't declare procedures such
  1909. ! #          as strstr
  1910. ! #--------------------------------------------------------------------
  1911.   
  1912.   AC_UNISTD_H
  1913.   AC_COMPILE_CHECK(dirent.h, [#include <sys/types.h>
  1914. ***************
  1915. *** 38,61 ****
  1916.   entryPtr = readdir(d);
  1917.   p = entryPtr->d_name;
  1918.   closedir(d);
  1919. ! ], , AC_DEFINE(NO_DIRENT_H))
  1920. ! AC_HEADER_EGREP([Sprite version.* NOT POSIX], AC_DEFINE(NO_DIRENT_H))
  1921.   AC_HEADER_CHECK(float.h, , AC_DEFINE(NO_FLOAT_H))
  1922.   AC_HEADER_CHECK(limits.h, , AC_DEFINE(NO_LIMITS_H))
  1923. ! AC_HEADER_CHECK(stdlib.h, , AC_DEFINE(NO_STDLIB_H))
  1924. ! AC_HEADER_EGREP(strtol, stdlib.h, , AC_DEFINE(NO_STDLIB_H))
  1925. ! AC_HEADER_EGREP(strtoul, stdlib.h, , AC_DEFINE(NO_STDLIB_H))
  1926. ! AC_HEADER_EGREP(strtod, stdlib.h, , AC_DEFINE(NO_STDLIB_H))
  1927. ! AC_HEADER_CHECK(string.h, , AC_DEFINE(NO_STRING_H))
  1928. ! AC_HEADER_EGREP(strstr, string.h, , AC_DEFINE(NO_STRING_H))
  1929. ! AC_HEADER_EGREP(strerror, string.h, , AC_DEFINE(NO_STRING_H))
  1930.   AC_HEADER_CHECK(sys/time.h, , AC_DEFINE(NO_SYS_TIME_H))
  1931.   AC_HEADER_CHECK(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H))
  1932.   
  1933. ! dnl--------------------------------------------------------------------
  1934. ! dnl    On some systems strstr is broken: it returns a pointer even
  1935. ! dnl    even if the original string is empty.
  1936. ! dnl--------------------------------------------------------------------
  1937.   
  1938.   AC_TEST_PROGRAM([
  1939.   extern int strstr();
  1940. --- 36,62 ----
  1941.   entryPtr = readdir(d);
  1942.   p = entryPtr->d_name;
  1943.   closedir(d);
  1944. ! ], tcl_ok=1, tcl_ok=0)
  1945. ! AC_HEADER_EGREP([Sprite version.* NOT POSIX], tcl_ok=0)
  1946. ! if test $tcl_ok = 0; then AC_DEFINE(NO_DIRENT_H); fi
  1947.   AC_HEADER_CHECK(float.h, , AC_DEFINE(NO_FLOAT_H))
  1948.   AC_HEADER_CHECK(limits.h, , AC_DEFINE(NO_LIMITS_H))
  1949. ! AC_HEADER_CHECK(stdlib.h, tcl_ok=1, tcl_ok=0)
  1950. ! AC_HEADER_EGREP(strtol, stdlib.h, , tcl_ok=0)
  1951. ! AC_HEADER_EGREP(strtoul, stdlib.h, , tcl_ok=0)
  1952. ! AC_HEADER_EGREP(strtod, stdlib.h, , tcl_ok=0)
  1953. ! if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H); fi
  1954. ! AC_HEADER_CHECK(string.h, tcl_ok=1, tcl_ok=0)
  1955. ! AC_HEADER_EGREP(strstr, string.h, , tcl_ok=0)
  1956. ! AC_HEADER_EGREP(strerror, string.h, , tcl_ok=0)
  1957. ! if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H); fi
  1958.   AC_HEADER_CHECK(sys/time.h, , AC_DEFINE(NO_SYS_TIME_H))
  1959.   AC_HEADER_CHECK(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H))
  1960.   
  1961. ! #--------------------------------------------------------------------
  1962. ! #    On some systems strstr is broken: it returns a pointer even
  1963. ! #    even if the original string is empty.
  1964. ! #--------------------------------------------------------------------
  1965.   
  1966.   AC_TEST_PROGRAM([
  1967.   extern int strstr();
  1968. ***************
  1969. *** 65,74 ****
  1970.   }
  1971.   ],  , [LIBOBJS="$LIBOBJS strstr.o"])
  1972.   
  1973. ! dnl--------------------------------------------------------------------
  1974. ! dnl    Under some versions of AIX strtoul returns an incorrect terminator
  1975. ! dnl    pointer for the string "0".
  1976. ! dnl--------------------------------------------------------------------
  1977.   
  1978.   AC_TEST_PROGRAM([
  1979.   extern int strtoul();
  1980. --- 66,75 ----
  1981.   }
  1982.   ],  , [LIBOBJS="$LIBOBJS strstr.o"])
  1983.   
  1984. ! #--------------------------------------------------------------------
  1985. ! #    Under some versions of AIX strtoul returns an incorrect terminator
  1986. ! #    pointer for the string "0".
  1987. ! #--------------------------------------------------------------------
  1988.   
  1989.   AC_TEST_PROGRAM([
  1990.   extern int strtoul();
  1991. ***************
  1992. *** 84,110 ****
  1993.       exit(0);
  1994.   }], , [LIBOBJS="$LIBOBJS strtoul.o"])
  1995.   
  1996. ! dnl--------------------------------------------------------------------
  1997. ! dnl    Check for missing pid_t and uid_t typedefs.
  1998. ! dnl--------------------------------------------------------------------
  1999.   
  2000.   AC_PID_T
  2001.   AC_UID_T
  2002.   
  2003. ! dnl--------------------------------------------------------------------
  2004. ! dnl    If a system doesn't have an opendir function (man, that's old!)
  2005. ! dnl    then we have to supply a different version of dirent.h which
  2006. ! dnl    is compatible with the substitute version of opendir that's
  2007. ! dnl    provided.  This version only works with V7-style directories.
  2008. ! dnl--------------------------------------------------------------------
  2009.   
  2010.   AC_FUNC_CHECK(opendir, , AC_DEFINE(USE_DIRENT2_H))
  2011.   
  2012. ! dnl--------------------------------------------------------------------
  2013. ! dnl    Check for the existence of sys_errlist (this is only needed if
  2014. ! dnl    there's no strerror, but I don't know how to conditionalize the
  2015. ! dnl    check).
  2016. ! dnl--------------------------------------------------------------------
  2017.   
  2018.   AC_COMPILE_CHECK(sys_errlist, , [
  2019.   extern char *sys_errlist[];
  2020. --- 85,114 ----
  2021.       exit(0);
  2022.   }], , [LIBOBJS="$LIBOBJS strtoul.o"])
  2023.   
  2024. ! #--------------------------------------------------------------------
  2025. ! #    Check for various typedefs and provide substitutes if
  2026. ! #    they don't exist.
  2027. ! #--------------------------------------------------------------------
  2028.   
  2029. + AC_MODE_T
  2030.   AC_PID_T
  2031. + AC_SIZE_T
  2032.   AC_UID_T
  2033.   
  2034. ! #--------------------------------------------------------------------
  2035. ! #    If a system doesn't have an opendir function (man, that's old!)
  2036. ! #    then we have to supply a different version of dirent.h which
  2037. ! #    is compatible with the substitute version of opendir that's
  2038. ! #    provided.  This version only works with V7-style directories.
  2039. ! #--------------------------------------------------------------------
  2040.   
  2041.   AC_FUNC_CHECK(opendir, , AC_DEFINE(USE_DIRENT2_H))
  2042.   
  2043. ! #--------------------------------------------------------------------
  2044. ! #    Check for the existence of sys_errlist (this is only needed if
  2045. ! #    there's no strerror, but I don't know how to conditionalize the
  2046. ! #    check).
  2047. ! #--------------------------------------------------------------------
  2048.   
  2049.   AC_COMPILE_CHECK(sys_errlist, , [
  2050.   extern char *sys_errlist[];
  2051. ***************
  2052. *** 112,124 ****
  2053.   sys_errlist[sys_nerr-1][0] = 0;
  2054.   ], , AC_DEFINE(NO_SYS_ERRLIST))
  2055.   
  2056. ! dnl--------------------------------------------------------------------
  2057. ! dnl    The check below checks whether <sys/wait.h> defines the type
  2058. ! dnl    "union wait" correctly.  It's needed because of weirdness in
  2059. ! dnl    HP-UX where "union wait" is defined in both the BSD and SYS-V
  2060. ! dnl    environments.  Checking the usability of WIFEXITED seems to do
  2061. ! dnl    the trick.
  2062. ! dnl--------------------------------------------------------------------
  2063.   
  2064.   AC_COMPILE_CHECK([union wait], [#include <sys/types.h> 
  2065.   #include <sys/wait.h>], [
  2066. --- 116,128 ----
  2067.   sys_errlist[sys_nerr-1][0] = 0;
  2068.   ], , AC_DEFINE(NO_SYS_ERRLIST))
  2069.   
  2070. ! #--------------------------------------------------------------------
  2071. ! #    The check below checks whether <sys/wait.h> defines the type
  2072. ! #    "union wait" correctly.  It's needed because of weirdness in
  2073. ! #    HP-UX where "union wait" is defined in both the BSD and SYS-V
  2074. ! #    environments.  Checking the usability of WIFEXITED seems to do
  2075. ! #    the trick.
  2076. ! #--------------------------------------------------------------------
  2077.   
  2078.   AC_COMPILE_CHECK([union wait], [#include <sys/types.h> 
  2079.   #include <sys/wait.h>], [
  2080. ***************
  2081. *** 127,146 ****
  2082.                * uses an int. */
  2083.   ], , AC_DEFINE(NO_UNION_WAIT))
  2084.   
  2085. ! dnl--------------------------------------------------------------------
  2086. ! dnl    The code below cleans up the DEFS variable to eliminate
  2087. ! dnl    duplicate entries.  This makes the eventual make output
  2088. ! dnl    look a bit cleaner.
  2089. ! dnl--------------------------------------------------------------------
  2090. ! newDefs=""
  2091. ! for i in $DEFS; do
  2092. !     if test -z "$newDefs"; then
  2093. !         newDefs=$i
  2094. !     elif echo $newDefs | fgrep -v -e $i >/dev/null 2>&1; then
  2095. !         newDefs="$newDefs $i"
  2096. !     fi
  2097. ! done
  2098. ! DEFS=$newDefs
  2099.   
  2100.   AC_OUTPUT(Makefile)
  2101. --- 131,145 ----
  2102.                * uses an int. */
  2103.   ], , AC_DEFINE(NO_UNION_WAIT))
  2104.   
  2105. ! #--------------------------------------------------------------------
  2106. ! #    Check to see whether the system supports the matherr function
  2107. ! #    and its associated type "struct exception".
  2108. ! #--------------------------------------------------------------------
  2109. ! AC_COMPILE_CHECK([matherr support], [#include <math.h>], [
  2110. ! struct exception x;
  2111. ! x.type = DOMAIN;
  2112. ! x.type = SING;
  2113. ! ], [LIBOBJS="$LIBOBJS tclMtherr.o"; AC_DEFINE(NEED_MATHERR)])
  2114.   
  2115.   AC_OUTPUT(Makefile)
  2116. *** ../tcl7.0b1/./changes    Wed Jul  7 16:25:16 1993
  2117. --- ./changes    Mon Jul 19 15:12:26 1993
  2118. ***************
  2119. *** 793,796 ****
  2120.   200. 7/7/93 Added Tcl_SetRecursionLimit procedure so that the maximum
  2121.   allowable nesting depth can be controlled for an interpreter from C.
  2122.   
  2123. ! ----------------- Released version 7.0 Beta 1, 6/9/93 ------------------
  2124. --- 793,827 ----
  2125.   200. 7/7/93 Added Tcl_SetRecursionLimit procedure so that the maximum
  2126.   allowable nesting depth can be controlled for an interpreter from C.
  2127.   
  2128. ! ----------------- Released version 7.0 Beta 1, 7/9/93 ------------------
  2129. ! 201. 7/12/93 Modified Tcl_GetInt and tclExpr.c so that full-precision
  2130. ! unsigned integers can be specified without overflow errors.
  2131. ! 202. 7/12/93 Configuration changes:  eliminate leading blank line in
  2132. ! configure script;  provide separate targets in Makefile for installing
  2133. ! binary and non-binary information; check for size_t and a few other
  2134. ! potentially missing typedefs; don't put tclAppInit.o into libtcl.a;
  2135. ! better checks for matherr support.
  2136. ! 203. 7/14/93 Changed tclExpr.c to check the termination pointer before
  2137. ! errno after strtod calls, to avoid problems with some versions of
  2138. ! strtod that set errno in unexpected ways.
  2139. ! 204. 7/16/93 Changed "scan" command to be more ANSI-conformant:
  2140. ! eliminated %F, %D, etc., added code to ignore "l", "h", and "L"
  2141. ! modifiers but always convert %e, %f, and %g with implicit "l";
  2142. ! also added support for %u and %i.  Also changed "format" command
  2143. ! to eliminate %D, %U, %O, and add %i.
  2144. ! *** POTENTIAL INCOMPATIBILITY ***
  2145. ! 205. 7/17/93 Changed "uplevel" and "upvar" so that they can be used
  2146. ! from global level to global level:  this used to generate an error.
  2147. ! 206. 7/19/93 Renamed "setenv", "putenv", and "unsetenv" procedures
  2148. ! to avoid conflicts with system procedures with the same names.  If
  2149. ! you want Tcl's procedures to override the system procedures, do it
  2150. ! in the Makefile (instructions are in the Makefile).
  2151. ! *** POTENTIAL INCOMPATIBILITY ***
  2152. ! ----------------- Released version 7.0 Beta 2, 7/21/93 ------------------
  2153. *** ../tcl7.0b1/./README    Fri Jul  9 13:41:00 1993
  2154. --- ./README    Mon Jul 19 15:07:14 1993
  2155. ***************
  2156. *** 9,15 ****
  2157.   
  2158.   This directory contains the sources and documentation for Tcl, an
  2159.   embeddable tool command language.  The information here corresponds
  2160. ! to release 7.0b1, the first beta release of Tcl 7.0.
  2161.   
  2162.   2. Documentation
  2163.   ----------------
  2164. --- 9,15 ----
  2165.   
  2166.   This directory contains the sources and documentation for Tcl, an
  2167.   embeddable tool command language.  The information here corresponds
  2168. ! to release 7.0b2, the first beta release of Tcl 7.0.
  2169.   
  2170.   2. Documentation
  2171.   ----------------
  2172. ***************
  2173. *** 53,62 ****
  2174.       Tcl commands interactively or execute script files.
  2175.   
  2176.       (c) If the make fails then you'll have to personalize the Makefile
  2177. !         for your site.  You may also wish to personalize the Makefile to
  2178. !     modify the install directories, etc.  There are comments at the
  2179. !     beginning of the Makefile that describe the things you might want
  2180. !     to change and how to change them.
  2181.   
  2182.       (d) Type "make install" to install Tcl binaries and script files in
  2183.           standard places.  You'll need write permission on /usr/local to
  2184. --- 53,63 ----
  2185.       Tcl commands interactively or execute script files.
  2186.   
  2187.       (c) If the make fails then you'll have to personalize the Makefile
  2188. !         for your site or possibly modify the distribution in other ways.
  2189. !     First check the file "porting.notes" to see if there are hints
  2190. !     for compiling on your system.  If you need to modify Makefile,
  2191. !     there are comments at the beginning of it that describe the things
  2192. !     you might want to change and how to change them.
  2193.   
  2194.       (d) Type "make install" to install Tcl binaries and script files in
  2195.           standard places.  You'll need write permission on /usr/local to
  2196. ***************
  2197. *** 117,127 ****
  2198.       the built-ins plus many other things, now contains a terse but
  2199.       complete description of the Tcl language syntax.
  2200.   
  2201. ! Here is a list of all of incompatibilities that affect Tcl scripts:
  2202.   
  2203.       1. There have been several changes to backslash processing:
  2204. !     - Unknown backslash sequences such as "\a" are now replaced with
  2205. !       the following character (such as "a");  Tcl used to treat the
  2206.         backslash as an ordinary character in these cases, so both the
  2207.         backslash and the following character would be passed through.
  2208.       - Backslash-newline now eats up any white space after the newline,
  2209. --- 118,128 ----
  2210.       the built-ins plus many other things, now contains a terse but
  2211.       complete description of the Tcl language syntax.
  2212.   
  2213. ! Here is a list of all incompatibilities that affect Tcl scripts:
  2214.   
  2215.       1. There have been several changes to backslash processing:
  2216. !     - Unknown backslash sequences such as "\*" are now replaced with
  2217. !       the following character (such as "*");  Tcl used to treat the
  2218.         backslash as an ordinary character in these cases, so both the
  2219.         backslash and the following character would be passed through.
  2220.       - Backslash-newline now eats up any white space after the newline,
  2221. ***************
  2222. *** 157,162 ****
  2223. --- 158,167 ----
  2224.       6. The keyword "UNIX" in the variable "errorCode" has been changed to
  2225.       "POSIX".
  2226.   
  2227. +     7. The "format" and "scan" commands no longer support capitalized
  2228. +     conversion specifiers such as "%D" that aren't supported by ANSI
  2229. +     sprintf and sscanf.
  2230.   Here is a list of all of the incompatibilities that affect C code that
  2231.   uses the Tcl library procedures.  If you use an ANSI C compiler then
  2232.   any potential problems will be detected when you compile your code:  if
  2233. ***************
  2234. *** 186,191 ****
  2235. --- 191,200 ----
  2236.   
  2237.       8. Tcl_UnixError has been renamed to Tcl_PosixError.
  2238.   
  2239. +     9. Tcl no longer redefines the library procedures "setenv", "putenv",
  2240. +     and "unsetenv" by default.  You have to set up special configuration
  2241. +     in the Makefile if you want this.
  2242.   Below is a sampler of the most important new features in Tcl 7.0.  Refer
  2243.   to the "changes" file for a complete list.
  2244.   
  2245. ***************
  2246. *** 229,236 ****
  2247.       that can be used to associated a C variable with a Tcl variable and
  2248.       keep them in sync.
  2249.   
  2250. !     10. A new library procedure Tcl_CommandInfo allows you to retrieve
  2251. !     the clientData of a command.
  2252.   
  2253.   6. Tcl newsgroup
  2254.   -----------------
  2255. --- 238,246 ----
  2256.       that can be used to associated a C variable with a Tcl variable and
  2257.       keep them in sync.
  2258.   
  2259. !     10. New library procedures Tcl_SetCommandInfo and Tcl_GetCommandInfo
  2260. !     allow you to set and get the clientData and callback procedure for
  2261. !     a command.
  2262.   
  2263.   6. Tcl newsgroup
  2264.   -----------------
  2265. *** ../tcl7.0b1/./porting.notes    Mon Jun 21 09:27:04 1993
  2266. --- ./porting.notes    Tue Jul 13 16:07:35 1993
  2267. ***************
  2268. *** 113,115 ****
  2269. --- 113,124 ----
  2270.   
  2271.   This brings in the typedef for pid_t, which is needed for
  2272.   /usr/include/sys/wait.h in tclUnix.h.
  2273. + ---------------------------------------------
  2274. + DEC Alphas:
  2275. + ---------------------------------------------
  2276. + 1. There appears to be a compiler/library bug that causes core-dumps
  2277. + unless you compile tclVar.c without optimization (remove the -O compiler
  2278. + switch).  The problem appears to have been fixed in the 1.3-4 version
  2279. + of the compiler.
  2280. *** ../tcl7.0b1/./doc/EnterFile.3    Thu Jul  1 15:23:24 1993
  2281. --- ./doc/EnterFile.3    Mon Jul 12 11:00:25 1993
  2282. ***************
  2283. *** 18,24 ****
  2284.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2285.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2286.   '\" 
  2287. ! '\" $Header: /user6/ouster/tcl/man/RCS/EnterFile.3,v 1.2 93/07/01 15:23:22 ouster Exp $ SPRITE (Berkeley)
  2288.   '\" 
  2289.   .so man.macros
  2290.   .HS Tcl_EnterFile tclc 7.0
  2291. --- 18,24 ----
  2292.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2293.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2294.   '\" 
  2295. ! '\" $Header: /user6/ouster/tcl/man/RCS/EnterFile.3,v 1.3 93/07/12 11:00:23 ouster Exp $ SPRITE (Berkeley)
  2296.   '\" 
  2297.   .so man.macros
  2298.   .HS Tcl_EnterFile tclc 7.0
  2299. ***************
  2300. *** 78,84 ****
  2301.   subprocesses, different FILE pointers will be returned for reading
  2302.   and writing.
  2303.   \fBTcl_GetOpenFile\fR normally returns TCL_OK.
  2304. ! If an error occurs in \fBTcl_OpenFile\fR (e.g. \fIstring\fR didn't
  2305.   make any sense or \fIcheckUsage\fR was set and the file wasn't opened
  2306.   for the access specified by \fIwrite\fR) then TCL_ERROR is returned
  2307.   and \fIinterp->result\fR will contain an error message.
  2308. --- 78,84 ----
  2309.   subprocesses, different FILE pointers will be returned for reading
  2310.   and writing.
  2311.   \fBTcl_GetOpenFile\fR normally returns TCL_OK.
  2312. ! If an error occurs in \fBTcl_GetOpenFile\fR (e.g. \fIstring\fR didn't
  2313.   make any sense or \fIcheckUsage\fR was set and the file wasn't opened
  2314.   for the access specified by \fIwrite\fR) then TCL_ERROR is returned
  2315.   and \fIinterp->result\fR will contain an error message.
  2316. *** ../tcl7.0b1/./doc/format.n    Mon May  3 17:09:44 1993
  2317. --- ./doc/format.n    Sat Jul 17 15:39:12 1993
  2318. ***************
  2319. *** 18,24 ****
  2320.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2321.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2322.   '\" 
  2323. ! '\" $Header: /user6/ouster/tcl/man/RCS/format.n,v 1.1 93/05/03 17:09:44 ouster Exp $ SPRITE (Berkeley)
  2324.   '\" 
  2325.   .so man.macros
  2326.   .HS format tcl
  2327. --- 18,24 ----
  2328.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2329.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2330.   '\" 
  2331. ! '\" $Header: /user6/ouster/tcl/man/RCS/format.n,v 1.2 93/07/17 15:39:01 ouster Exp $ SPRITE (Berkeley)
  2332.   '\" 
  2333.   .so man.macros
  2334.   .HS format tcl
  2335. ***************
  2336. *** 33,56 ****
  2337.   .SH DESCRIPTION
  2338.   .PP
  2339.   This command generates a formatted string in the same way as the
  2340. ! C \fBsprintf\fR procedure (it uses \fBsprintf\fR in its
  2341. ! implementation).  \fIFormatString\fR indicates how to format
  2342. ! the result, using \fB%\fR fields as in \fBsprintf\fR, and the additional
  2343.   arguments, if any, provide values to be substituted into the result.
  2344. ! All of the \fBsprintf\fR options are valid; see the \fBsprintf\fR
  2345. ! man page for details.
  2346.   .VS
  2347.   The \fBformat\fR command also supports the XPG3 ``%n$'' positional
  2348.   specifiers.
  2349.   .VE
  2350. - Each \fIarg\fR must match the expected type
  2351. - from the \fB%\fR field in \fIformatString\fR; the \fBformat\fR command
  2352. - converts each argument to the correct type (floating, integer, etc.)
  2353. - before passing it to \fBsprintf\fR for formatting.
  2354. - The only unusual conversion is for \fB%c\fR; in this case the argument
  2355. - must be a decimal string, which will then be converted to the corresponding
  2356. - ASCII character value.
  2357. - The return value from \fBformat\fR is the formatted string.
  2358.   
  2359.   .SH KEYWORDS
  2360.   format, sprintf, string, substitution
  2361. --- 33,72 ----
  2362.   .SH DESCRIPTION
  2363.   .PP
  2364.   This command generates a formatted string in the same way as the
  2365. ! ANSI C \fBsprintf\fR procedure (it uses \fBsprintf\fR in its
  2366. ! implementation).
  2367. ! \fIFormatString\fR indicates how to format the result, using
  2368. ! \fB%\fR conversion specifiers as in \fBsprintf\fR, and the additional
  2369.   arguments, if any, provide values to be substituted into the result.
  2370. ! Each \fIarg\fR must match the expected type
  2371. ! from the corresponding conversion specifier in \fIformatString\fR;
  2372. ! the \fBformat\fR command converts each argument to the correct
  2373. ! type (floating, integer, etc.) before passing it to \fBsprintf\fR
  2374. ! for formatting.
  2375. ! The return value from \fBformat\fR is the formatted string.
  2376. ! .PP
  2377. ! .VS
  2378. ! The conversion specifiers for \fBformat\fR are identical in syntax
  2379. ! and effect to those for \fBsprintf\fR except for the following
  2380. ! differences:
  2381. ! .IP [1]
  2382. ! \fB%p\fR and \fB%n\fR specifiers are not currently supported.
  2383. ! .VE
  2384. ! .IP [2]
  2385. ! For \fB%c\fR conmversions the argument must be a decimal string,
  2386. ! which will then be converted to the corresponding ASCII character value.
  2387. ! .IP [3]
  2388.   .VS
  2389. + The \fBl\fR modifier is ignored;  integer values are always converted
  2390. + as if there were no modifier present and real values are always
  2391. + converted as if the \fBl\fR modifier were present (i.e. type
  2392. + \fBdouble\fR is used for the internal representation).
  2393. + If the \fBh\fR modifier is specified then integer values are truncated
  2394. + to \fBshort\fR before conversion.
  2395. + .PP
  2396.   The \fBformat\fR command also supports the XPG3 ``%n$'' positional
  2397.   specifiers.
  2398.   .VE
  2399.   
  2400.   .SH KEYWORDS
  2401.   format, sprintf, string, substitution
  2402. *** ../tcl7.0b1/./doc/return.n    Wed Jul  7 16:37:49 1993
  2403. --- ./doc/return.n    Fri Jul 16 16:31:18 1993
  2404. ***************
  2405. *** 18,24 ****
  2406.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2407.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2408.   '\" 
  2409. ! '\" $Header: /user6/ouster/tcl/man/RCS/return.n,v 1.4 93/07/07 16:37:43 ouster Exp $ SPRITE (Berkeley)
  2410.   '\" 
  2411.   .so man.macros
  2412.   .HS return tcl 7.0
  2413. --- 18,24 ----
  2414.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2415.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2416.   '\" 
  2417. ! '\" $Header: /user6/ouster/tcl/man/RCS/return.n,v 1.5 93/07/16 16:31:07 ouster Exp $ SPRITE (Berkeley)
  2418.   '\" 
  2419.   .so man.macros
  2420.   .HS return tcl 7.0
  2421. ***************
  2422. *** 27,33 ****
  2423.   .SH NAME
  2424.   return \- Return from a procedure
  2425.   .SH SYNOPSIS
  2426. ! \fBreturn \fR?\fIvalue\fR? ?\fIcode\fR?
  2427.   .BE
  2428.   
  2429.   .SH DESCRIPTION
  2430. --- 27,33 ----
  2431.   .SH NAME
  2432.   return \- Return from a procedure
  2433.   .SH SYNOPSIS
  2434. ! \fBreturn \fR?\fB\-code \fIcode\fR? ?\fIstring\fR?
  2435.   .BE
  2436.   
  2437.   .SH DESCRIPTION
  2438. ***************
  2439. *** 34,52 ****
  2440.   .PP
  2441.   Return immediately from the current procedure
  2442.   (or top-level command or \fBsource\fR command),
  2443. ! with \fIvalue\fR as the return value.  If \fIvalue\fR is not specified then
  2444.   an empty string will be returned as result.
  2445.   .PP
  2446. ! In the normal case where \fIcode\fR isn't specified the procedure
  2447.   .VS
  2448. ! will return normally (its completion code will be TCL_OK).
  2449. ! However, \fIcode\fR may be used to cause the procedure to return
  2450. ! with an exceptional completion code, which will generate an exception
  2451. ! in the script that invoked the current procedure.
  2452.   \fICode\fR may have any of the following values:
  2453.   .TP 10
  2454.   \fBok\fR
  2455. ! Normal return:  same as if \fIcode\fR were omitted.
  2456.   .TP 10
  2457.   \fBerror\fR
  2458.   Error return: same as if the \fBerror\fR command were used to
  2459. --- 34,53 ----
  2460.   .PP
  2461.   Return immediately from the current procedure
  2462.   (or top-level command or \fBsource\fR command),
  2463. ! with \fIstring\fR as the return value.  If \fIstring\fR is not specified then
  2464.   an empty string will be returned as result.
  2465.   .PP
  2466. ! In the usual case where the \fB\-code\fR option isn't
  2467.   .VS
  2468. ! specified the procedure will return normally (its completion
  2469. ! code will be TCL_OK).
  2470. ! However, the \fB\-code\fR option may be used to cause the
  2471. ! procedure to return with an exceptional completion code,
  2472. ! which will generate an exception in the script that invoked the procedure.
  2473.   \fICode\fR may have any of the following values:
  2474.   .TP 10
  2475.   \fBok\fR
  2476. ! Normal return:  same as if the option is omitted.
  2477.   .TP 10
  2478.   \fBerror\fR
  2479.   Error return: same as if the \fBerror\fR command were used to
  2480. ***************
  2481. *** 72,78 ****
  2482.   \fIValue\fR must be an integer;  it will be returned as the
  2483.   completion code for the current procedure.
  2484.   .LP
  2485. ! \fICode\fR is rarely used.
  2486.   It is provided so that procedures that implement
  2487.   new control structures can reflect exceptional conditions back to
  2488.   their callers.
  2489. --- 73,79 ----
  2490.   \fIValue\fR must be an integer;  it will be returned as the
  2491.   completion code for the current procedure.
  2492.   .LP
  2493. ! The \fB\-code\fR option is rarely used.
  2494.   It is provided so that procedures that implement
  2495.   new control structures can reflect exceptional conditions back to
  2496.   their callers.
  2497. *** ../tcl7.0b1/./doc/scan.n    Mon Jun  7 16:48:27 1993
  2498. --- ./doc/scan.n    Fri Jul 16 16:56:14 1993
  2499. ***************
  2500. *** 18,24 ****
  2501.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2502.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2503.   '\" 
  2504. ! '\" $Header: /user6/ouster/tcl/man/RCS/scan.n,v 1.1 93/06/07 16:48:26 ouster Exp $ SPRITE (Berkeley)
  2505.   '\" 
  2506.   .so man.macros
  2507.   .HS scan tcl
  2508. --- 18,24 ----
  2509.   '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2510.   '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2511.   '\" 
  2512. ! '\" $Header: /user6/ouster/tcl/man/RCS/scan.n,v 1.2 93/07/16 16:55:51 ouster Exp $ SPRITE (Berkeley)
  2513.   '\" 
  2514.   .so man.macros
  2515.   .HS scan tcl
  2516. ***************
  2517. *** 33,50 ****
  2518.   .SH DESCRIPTION
  2519.   .PP
  2520.   This command parses fields from an input string in the same fashion
  2521. ! as the C \fBsscanf\fR procedure and returns a count of the number
  2522.   of fields sucessfully parsed.  \fIString\fR gives the input to
  2523.   be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR
  2524. ! fields as in \fBsscanf\fR.  All of the \fBsscanf\fR options are valid;
  2525. ! see the \fBsscanf\fR man page for details.  Each \fIvarName\fR gives
  2526.   the name of a variable; when a field is scanned from \fIstring\fR,
  2527.   the result is converted back into a string and assigned to the
  2528. ! corresponding \fIvarName\fR.  The only unusual conversion is for
  2529. ! \fB%c\fR.  For \fB%c\fR conversions a single character value is
  2530.   converted to a decimal string, which is then assigned to the
  2531.   corresponding \fIvarName\fR;
  2532.   no field width may be specified for this conversion.
  2533.   
  2534.   .SH KEYWORDS
  2535.   parse, scan
  2536. --- 33,65 ----
  2537.   .SH DESCRIPTION
  2538.   .PP
  2539.   This command parses fields from an input string in the same fashion
  2540. ! as the ANSI C \fBsscanf\fR procedure and returns a count of the number
  2541.   of fields sucessfully parsed.  \fIString\fR gives the input to
  2542.   be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR
  2543. ! fields as in \fBsscanf\fR.  Each \fIvarName\fR gives
  2544.   the name of a variable; when a field is scanned from \fIstring\fR,
  2545.   the result is converted back into a string and assigned to the
  2546. ! corresponding \fIvarName\fR. 
  2547. ! All of the \fBsscanf\fR conversion specifiers are valid except for
  2548. ! the following differences:
  2549. ! .IP [1]
  2550. ! .VS
  2551. ! \fB%p\fR and \fB%n\fR conversion specifiers are not currently
  2552. ! supported.
  2553. ! .VE
  2554. ! .IP [2]
  2555. ! For \fB%c\fR conversions a single character value is
  2556.   converted to a decimal string, which is then assigned to the
  2557.   corresponding \fIvarName\fR;
  2558.   no field width may be specified for this conversion.
  2559. + .IP [3]
  2560. + .VS
  2561. + The \fBl\fR, \fBh\fR, and \fBL\fR modifiers are ignored;  integer
  2562. + values are always converted as if there were no modifier present
  2563. + and real values are always converted as if the \fBl\fR modifier
  2564. + were present (i.e. type \fBdouble\fR is used for the internal
  2565. + representation).
  2566. + .VE
  2567.   
  2568.   .SH KEYWORDS
  2569.   parse, scan
  2570. *** ../tcl7.0b1/./compat/getcwd.c    Thu Jun  3 15:08:50 1993
  2571. --- ./compat/getcwd.c    Mon Jul 12 14:01:03 1993
  2572. ***************
  2573. *** 26,33 ****
  2574.    */
  2575.   
  2576.   #ifndef lint
  2577. ! static char rcsid[] = "$Header: /user6/ouster/tcl/compat/RCS/strtod.c,v 1.4 93/0
  2578. ! 3/19 15:25:47 ouster Exp $ SPRITE (Berkeley)";
  2579.   #endif /* not lint */
  2580.   
  2581.   #include "tclInt.h"
  2582. --- 26,32 ----
  2583.    */
  2584.   
  2585.   #ifndef lint
  2586. ! static char rcsid[] = "$Header: /user6/ouster/tcl/compat/RCS/getcwd.c,v 1.2 93/07/12 14:00:59 ouster Exp $ SPRITE (Berkeley)";
  2587.   #endif /* not lint */
  2588.   
  2589.   #include "tclInt.h"
  2590. *** ../tcl7.0b1/./compat/strtod.c    Fri Mar 19 15:25:49 1993
  2591. --- ./compat/strtod.c    Mon Jul 12 14:01:20 1993
  2592. ***************
  2593. *** 25,35 ****
  2594.    */
  2595.   
  2596.   #ifndef lint
  2597. ! static char rcsid[] = "$Header: /user6/ouster/tcl/compat/RCS/strtod.c,v 1.4 93/03/19 15:25:47 ouster Exp $ SPRITE (Berkeley)";
  2598.   #endif /* not lint */
  2599.   
  2600.   #include <tcl.h>
  2601. ! #include <stdlib.h>
  2602.   #include <ctype.h>
  2603.   
  2604.   #ifndef TRUE
  2605. --- 25,39 ----
  2606.    */
  2607.   
  2608.   #ifndef lint
  2609. ! static char rcsid[] = "$Header: /user6/ouster/tcl/compat/RCS/strtod.c,v 1.5 93/07/12 14:01:07 ouster Exp $ SPRITE (Berkeley)";
  2610.   #endif /* not lint */
  2611.   
  2612.   #include <tcl.h>
  2613. ! #ifdef NO_STDLIB_H
  2614. ! #   include "compat/stdlib.h"
  2615. ! #else
  2616. ! #   include <stdlib.h>
  2617. ! #endif
  2618.   #include <ctype.h>
  2619.   
  2620.   #ifndef TRUE
  2621. *** ../tcl7.0b1/./compat/unistd.h    Thu Jun  3 15:08:41 1993
  2622. --- ./compat/unistd.h    Fri Jul 16 09:32:52 1993
  2623. ***************
  2624. *** 12,18 ****
  2625.    * software for any purpose.  It is provided "as is" without
  2626.    * express or implied warranty.
  2627.    *
  2628. !  * $Header: /user6/ouster/tcl/compat/RCS/unistd.h,v 1.1 93/06/03 15:08:39 ouster Exp $
  2629.    */
  2630.   
  2631.   #ifndef _UNISTD
  2632. --- 12,18 ----
  2633.    * software for any purpose.  It is provided "as is" without
  2634.    * express or implied warranty.
  2635.    *
  2636. !  * $Header: /user6/ouster/tcl/compat/RCS/unistd.h,v 1.2 93/07/16 09:32:43 ouster Exp $
  2637.    */
  2638.   
  2639.   #ifndef _UNISTD
  2640. ***************
  2641. *** 77,83 ****
  2642.   extern int ttyslot _ANSI_ARGS_((void));
  2643.   extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length));
  2644.   extern int umask _ANSI_ARGS_((int cmask));
  2645. ! extern _VoidPtr    valloc _ANSI_ARGS_((size_t bytes));
  2646.   extern int vfork _ANSI_ARGS_((void));
  2647.   #endif /* _POSIX_SOURCE */
  2648.   
  2649. --- 77,83 ----
  2650.   extern int ttyslot _ANSI_ARGS_((void));
  2651.   extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length));
  2652.   extern int umask _ANSI_ARGS_((int cmask));
  2653. ! extern VOID valloc _ANSI_ARGS_((size_t bytes));
  2654.   extern int vfork _ANSI_ARGS_((void));
  2655.   #endif /* _POSIX_SOURCE */
  2656.   
  2657. *** ../tcl7.0b1/./tests/expr.test    Wed Jul  7 16:23:14 1993
  2658. --- ./tests/expr.test    Mon Jul 12 11:35:07 1993
  2659. ***************
  2660. *** 24,30 ****
  2661.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2662.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2663.   #
  2664. ! # $Header: /user6/ouster/tcl/tests/RCS/expr.test,v 1.22 93/07/07 16:21:32 ouster Exp $ (Berkeley)
  2665.   
  2666.   if {[string compare test [info procs test]] == 1} then {source defs}
  2667.   
  2668. --- 24,30 ----
  2669.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2670.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2671.   #
  2672. ! # $Header: /user6/ouster/tcl/tests/RCS/expr.test,v 1.23 93/07/12 11:34:55 ouster Exp $ (Berkeley)
  2673.   
  2674.   if {[string compare test [info procs test]] == 1} then {source defs}
  2675.   
  2676. ***************
  2677. *** 309,316 ****
  2678.       set y 10
  2679.       expr {$x + $y}
  2680.   } {5}
  2681. ! test expr-22.3 {embedded commands and variables} {expr {[set a] - 14}} 2
  2682. ! test expr-22.4 {embedded commands and variables} {
  2683.       list [catch {expr {12 - [bad_command_name]}} msg] $msg
  2684.   } {1 {invalid command name: "bad_command_name"}}
  2685.   
  2686. --- 309,321 ----
  2687.       set y 10
  2688.       expr {$x + $y}
  2689.   } {5}
  2690. ! test expr-22.3 {embedded variables} {
  2691. !     set x "  -5"
  2692. !     set y "  +10"
  2693. !     expr {$x + $y}
  2694. ! } {5}
  2695. ! test expr-22.4 {embedded commands and variables} {expr {[set a] - 14}} 2
  2696. ! test expr-22.5 {embedded commands and variables} {
  2697.       list [catch {expr {12 - [bad_command_name]}} msg] $msg
  2698.   } {1 {invalid command name: "bad_command_name"}}
  2699.   
  2700. *** ../tcl7.0b1/./tests/format.test    Wed Jul  7 16:21:32 1993
  2701. --- ./tests/format.test    Sat Jul 17 15:25:07 1993
  2702. ***************
  2703. *** 24,30 ****
  2704.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2705.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2706.   #
  2707. ! # $Header: /user6/ouster/tcl/tests/RCS/format.test,v 1.14 93/07/07 16:21:15 ouster Exp $ (Berkeley)
  2708.   
  2709.   if {[string compare test [info procs test]] == 1} then {source defs}
  2710.   
  2711. --- 24,30 ----
  2712.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2713.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2714.   #
  2715. ! # $Header: /user6/ouster/tcl/tests/RCS/format.test,v 1.16 93/07/17 15:25:01 ouster Exp $ (Berkeley)
  2716.   
  2717.   if {[string compare test [info procs test]] == 1} then {source defs}
  2718.   
  2719. ***************
  2720. *** 57,66 ****
  2721.       } {   6   34 16923 4294967284 -1 0}
  2722.   }
  2723.   test format-1.4 {integer formatting} {
  2724. !     format "%-4d %-4d %-4d %-4ld" 6 34 16923 -12 -1
  2725.   } {6    34   16923 -12 }
  2726.   test format-1.5 {integer formatting} {
  2727. !     format "%04d %04d %04d %04d" 6 34 16923 -12 -1
  2728.   } {0006 0034 16923 -012}
  2729.   test format-1.6 {integer formatting} {
  2730.       format "%00*d" 6 34
  2731. --- 57,66 ----
  2732.       } {   6   34 16923 4294967284 -1 0}
  2733.   }
  2734.   test format-1.4 {integer formatting} {
  2735. !     format "%-4d %-4i %-4d %-4ld" 6 34 16923 -12 -1
  2736.   } {6    34   16923 -12 }
  2737.   test format-1.5 {integer formatting} {
  2738. !     format "%04d %04d %04d %04i" 6 34 16923 -12 -1
  2739.   } {0006 0034 16923 -012}
  2740.   test format-1.6 {integer formatting} {
  2741.       format "%00*d" 6 34
  2742. ***************
  2743. *** 339,347 ****
  2744.       test format-9.3 {"h" format specifier} {
  2745.       format %hd 0x10000
  2746.       } 0
  2747. -     test format-9.4 {"h" format specifier} {
  2748. -     format %hD 0x10000
  2749. -     } 65536
  2750.   }
  2751.   
  2752.   test format-10.1 {XPG3 %$n specifiers} {
  2753. --- 339,344 ----
  2754. *** ../tcl7.0b1/./tests/incr.test    Wed Jun 16 10:58:09 1993
  2755. --- ./tests/incr.test    Mon Jul 12 11:34:52 1993
  2756. ***************
  2757. *** 24,30 ****
  2758.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2759.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2760.   #
  2761. ! # $Header: /user6/ouster/tcl/tests/RCS/incr.test,v 1.4 93/06/16 10:57:48 ouster Exp $ (Berkeley)
  2762.   
  2763.   if {[string compare test [info procs test]] == 1} then {source defs}
  2764.   
  2765. --- 24,30 ----
  2766.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2767.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2768.   #
  2769. ! # $Header: /user6/ouster/tcl/tests/RCS/incr.test,v 1.5 93/07/12 11:34:43 ouster Exp $ (Berkeley)
  2770.   
  2771.   if {[string compare test [info procs test]] == 1} then {source defs}
  2772.   
  2773. ***************
  2774. *** 38,43 ****
  2775. --- 38,51 ----
  2776.       set x 106
  2777.       list [incr x -5] $x
  2778.   } {101 101}
  2779. + test incr-1.3 {basic incr operation} {
  2780. +     set x "  -106"
  2781. +     list [incr x 1] $x
  2782. + } {-105 -105}
  2783. + test incr-1.3 {basic incr operation} {
  2784. +     set x "  +106"
  2785. +     list [incr x 1] $x
  2786. + } {107 107}
  2787.   
  2788.   test incr-2.1 {incr errors} {
  2789.       list [catch incr msg] $msg
  2790. *** ../tcl7.0b1/./tests/proc.test    Wed Jun 16 15:59:07 1993
  2791. --- ./tests/proc.test    Fri Jul 16 15:27:56 1993
  2792. ***************
  2793. *** 24,30 ****
  2794.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2795.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2796.   #
  2797. ! # $Header: /user6/ouster/tcl/tests/RCS/proc.test,v 1.13 93/06/16 15:58:55 ouster Exp $ (Berkeley)
  2798.   
  2799.   if {[string compare test [info procs test]] == 1} then {source defs}
  2800.   
  2801. --- 24,30 ----
  2802.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2803.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2804.   #
  2805. ! # $Header: /user6/ouster/tcl/tests/RCS/proc.test,v 1.14 93/07/16 15:27:50 ouster Exp $ (Berkeley)
  2806.   
  2807.   if {[string compare test [info procs test]] == 1} then {source defs}
  2808.   
  2809. ***************
  2810. *** 279,287 ****
  2811.       catch {return}
  2812.   } 2
  2813.   test proc-5.9 {error conditions} {
  2814. !     list [catch {return 1 2 3} msg] $msg
  2815. ! } {1 {wrong # args: should be "return ?value? ?code?"}}
  2816.   test proc-5.10 {error conditions} {
  2817.       list [catch {global} msg] $msg
  2818.   } {1 {wrong # args: should be "global varName ?varName ...?"}}
  2819.   proc tproc {} {
  2820. --- 279,290 ----
  2821.       catch {return}
  2822.   } 2
  2823.   test proc-5.9 {error conditions} {
  2824. !     list [catch {return 1 2 3 4} msg] $msg
  2825. ! } {1 {wrong # args: should be "return ?-code code? ?string?"}}
  2826.   test proc-5.10 {error conditions} {
  2827. +     list [catch {return -coed 3} msg] $msg
  2828. + } {1 {wrong # args: should be "return ?-code code? ?string?"}}
  2829. + test proc-5.11 {error conditions} {
  2830.       list [catch {global} msg] $msg
  2831.   } {1 {wrong # args: should be "global varName ?varName ...?"}}
  2832.   proc tproc {} {
  2833. ***************
  2834. *** 288,297 ****
  2835.       set a 22
  2836.       global a
  2837.   }
  2838. ! test proc-5.11 {error conditions} {
  2839.       list [catch {tproc} msg] $msg
  2840.   } {1 {variable "a" already exists}}
  2841. ! test proc-5.12 {error conditions} {
  2842.       catch {rename tproc {}}
  2843.       catch {
  2844.       proc tproc {x {} z} {return foo}
  2845. --- 291,300 ----
  2846.       set a 22
  2847.       global a
  2848.   }
  2849. ! test proc-5.12 {error conditions} {
  2850.       list [catch {tproc} msg] $msg
  2851.   } {1 {variable "a" already exists}}
  2852. ! test proc-5.13 {error conditions} {
  2853.       catch {rename tproc {}}
  2854.       catch {
  2855.       proc tproc {x {} z} {return foo}
  2856. ***************
  2857. *** 298,304 ****
  2858.       }
  2859.       list [catch {tproc 1} msg] $msg
  2860.   } {1 {invalid command name: "tproc"}}
  2861. ! test proc-5.13 {error conditions} {
  2862.       proc tproc {} {
  2863.       set a 22
  2864.       error "error in procedure"
  2865. --- 301,307 ----
  2866.       }
  2867.       list [catch {tproc 1} msg] $msg
  2868.   } {1 {invalid command name: "tproc"}}
  2869. ! test proc-5.14 {error conditions} {
  2870.       proc tproc {} {
  2871.       set a 22
  2872.       error "error in procedure"
  2873. ***************
  2874. *** 306,312 ****
  2875.       }
  2876.       list [catch tproc msg] $msg
  2877.   } {1 {error in procedure}}
  2878. ! test proc-5.14 {error conditions} {
  2879.       proc tproc {} {
  2880.       set a 22
  2881.       error "error in procedure"
  2882. --- 309,315 ----
  2883.       }
  2884.       list [catch tproc msg] $msg
  2885.   } {1 {error in procedure}}
  2886. ! test proc-5.15 {error conditions} {
  2887.       proc tproc {} {
  2888.       set a 22
  2889.       error "error in procedure"
  2890. ***************
  2891. *** 320,326 ****
  2892.       (procedure "tproc" line 3)
  2893.       invoked from within
  2894.   "tproc"}
  2895. ! test proc-5.15 {error conditions} {
  2896.       proc tproc {} {
  2897.       set a 22
  2898.       break
  2899. --- 323,329 ----
  2900.       (procedure "tproc" line 3)
  2901.       invoked from within
  2902.   "tproc"}
  2903. ! test proc-5.16 {error conditions} {
  2904.       proc tproc {} {
  2905.       set a 22
  2906.       break
  2907. ***************
  2908. *** 331,337 ****
  2909.   } {invoked "break" outside of a loop
  2910.       while executing
  2911.   "tproc"}
  2912. ! test proc-5.16 {error conditions} {
  2913.       proc tproc {} {
  2914.       set a 22
  2915.       continue
  2916. --- 334,340 ----
  2917.   } {invoked "break" outside of a loop
  2918.       while executing
  2919.   "tproc"}
  2920. ! test proc-5.17 {error conditions} {
  2921.       proc tproc {} {
  2922.       set a 22
  2923.       continue
  2924. ***************
  2925. *** 364,370 ****
  2926.   } 45
  2927.   
  2928.   proc tproc code {
  2929. !     return abc $code
  2930.   }
  2931.   test proc-7.1 {return with special completion code} {
  2932.       list [catch {tproc ok} msg] $msg
  2933. --- 367,373 ----
  2934.   } 45
  2935.   
  2936.   proc tproc code {
  2937. !     return -code $code abc
  2938.   }
  2939.   test proc-7.1 {return with special completion code} {
  2940.       list [catch {tproc ok} msg] $msg
  2941. ***************
  2942. *** 396,398 ****
  2943. --- 399,407 ----
  2944.       }
  2945.       list [catch tproc2 msg] $msg
  2946.   } {0 abc}
  2947. + test proc-7.10 {return with special completion code} {
  2948. +     proc tproc2 {} {
  2949. +     return -code error
  2950. +     }
  2951. +     list [catch tproc2 msg] $msg
  2952. + } {1 {}}
  2953. *** ../tcl7.0b1/./tests/scan.test    Thu Jun  3 10:35:58 1993
  2954. --- ./tests/scan.test    Fri Jul 16 16:50:42 1993
  2955. ***************
  2956. *** 24,545 ****
  2957.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  2958.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  2959.   #
  2960. ! # $Header: /user6/ouster/tcl/tests/RCS/scan.test,v 1.14 93/06/03 10:35:48 ouster Exp $ (Berkeley)
  2961.   
  2962.   if {[string compare test [info procs test]] == 1} then {source defs}
  2963.   
  2964.   test scan-1.1 {integer scanning} {
  2965.       set a {}; set b {}; set c {}; set d {}
  2966. !     scan "-20 1476 \n33 0" "%d %d %d %d" a b c d
  2967. ! } 4
  2968.   test scan-1.2 {integer scanning} {
  2969. !     set a {}; set b {}; set c {}; set d {}
  2970. !     scan "-20 1476 \n33 0" "%d %d %d %d" a b c d
  2971. !     set a
  2972. ! } -20
  2973.   test scan-1.3 {integer scanning} {
  2974.       set a {}; set b {}; set c {}; set d {}
  2975. !     scan "-20 1476 \n33 0" "%d %d %d %d" a b c d
  2976. !     set b
  2977. ! } 1476
  2978.   test scan-1.4 {integer scanning} {
  2979.       set a {}; set b {}; set c {}; set d {}
  2980. !     scan "-20 1476 \n33 0" "%d %d %d %d" a b c d
  2981. !     set c
  2982. ! } 33
  2983.   test scan-1.5 {integer scanning} {
  2984.       set a {}; set b {}; set c {}; set d {}
  2985. !     scan "-20 1476 \n33 0" "%d %d %d %d" a b c d
  2986. !     set d
  2987. ! } 0
  2988.   test scan-1.6 {integer scanning} {
  2989. !     set a {}; set b {}; set c {}
  2990. !     scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c
  2991. ! } 3
  2992.   test scan-1.7 {integer scanning} {
  2993. !     set a {}; set b {}; set c {}
  2994. !     scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c
  2995. !     set a
  2996. ! } -4
  2997.   test scan-1.8 {integer scanning} {
  2998. !     set a {}; set b {}; set c {}
  2999. !     scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c
  3000. !     set b
  3001. ! } 16
  3002.   test scan-1.9 {integer scanning} {
  3003. !     set a {}; set b {}; set c {}
  3004. !     scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c
  3005. !     set c
  3006. ! } 7890
  3007. ! # Capitalized format specifiers don't work on some systems, so
  3008. ! # only run the following tests at Berkeley.
  3009.   if $atBerkeley {
  3010. -     test scan-1.10 {integer scanning} {
  3011. -     set a {}; set b {}; set c {}; set d {}
  3012. -     scan "-45 16 +10 987" "%D %d %D %d" a b c d
  3013. -     } 4
  3014.       test scan-1.11 {integer scanning} {
  3015. !     set a {}; set b {}; set c {}; set d {}
  3016. !     scan "-45 16 +10 987" "%D %d %D %d" a b c d
  3017. !     set a
  3018. !     } -45
  3019. !     test scan-1.12 {integer scanning} {
  3020. !     set a {}; set b {}; set c {}; set d {}
  3021. !     scan "-45 16 +10 987" "%D %d%D %d" a b c d
  3022. !     set b
  3023. !     } 16
  3024. !     test scan-1.13 {integer scanning} {
  3025. !     set a {}; set b {}; set c {}; set d {}
  3026. !     scan "-45 16 +10 987" "%D %d %D %d" a b c d
  3027. !     set c
  3028. !     } 10
  3029. !     test scan-1.14 {integer scanning} {
  3030. !     set a {}; set b {}; set c {}; set d {}
  3031. !     scan "-45 16 +10 987" "%D %d %D %d" a b c d
  3032. !     set d
  3033. !     } 987
  3034. !     test scan-1.15 {integer scanning} {
  3035. !     set a {}; set b {}; set c {}; set d {}
  3036. !     scan "14 1ab 62 10" "%d %x %O %x" a b c d
  3037. !     } 4
  3038. !     test scan-1.16 {integer scanning} {
  3039. !     set a {}; set b {}; set c {}; set d {}
  3040. !     scan "14 1ab 62 10" "%d %x %O %x" a b c d
  3041. !     set a
  3042. !     } 14
  3043. !     test scan-1.17 {integer scanning} {
  3044. !     set a {}; set b {}; set c {}; set d {}
  3045. !     scan "14 1ab 62 10" "%d %x %O %x" a b c d
  3046. !     set b
  3047. !     } 427
  3048. !     test scan-1.18 {integer scanning} {
  3049. !     set a {}; set b {}; set c {}; set d {}
  3050. !     scan "14 1ab 62 10" "%d %x %O %x" a b c d
  3051. !     set c
  3052. !     } 50
  3053. !     test scan-1.19 {integer scanning} {
  3054. !     set a {}; set b {}; set c {}; set d {}
  3055. !     scan "14 1ab 62 10" "%d %x %O %x" a b c d
  3056. !     set d
  3057. !     } 16
  3058. !     test scan-1.20 {integer scanning} {
  3059. !     set a {}; set b {}; set c {}; set d {}
  3060. !     scan "12345670 1234567890ab cdefg" "%o     %o %x %X" a b c d
  3061. !     } 4
  3062.   }
  3063. - test scan-1.21 {integer scanning} {
  3064. -     set a {}; set b {}; set c {}; set d {}
  3065. -     scan "12345670 1234567890ab cdefg" "%o     %o %x %X" a b c d
  3066. -     set a
  3067. - } 2739128
  3068. - test scan-1.22 {integer scanning} {
  3069. -     set a {}; set b {}; set c {}; set d {}
  3070. -     scan "12345670 1234567890ab cdefg" "%o     %o %x %X" a b c d
  3071. -     set b
  3072. - } 342391
  3073. - test scan-1.23 {integer scanning} {
  3074. -     set a {}; set b {}; set c {}; set d {}
  3075. -     scan "12345670 1234567890ab cdefg" "%o     %o %x %X" a b c d
  3076. -     set c
  3077. - } 561323
  3078. - test scan-1.24 {integer scanning} {
  3079. -     set a {}; set b {}; set c {}; set d {}
  3080. -     scan "12345670 1234567890ab cdefg" "%o     %o %x %X" a b c d
  3081. -     set d
  3082. - } 52719
  3083. - test scan-1.25 {integer scanning} {
  3084. -     set a {}; set b {}; set c {}; set d {}
  3085. -     scan "ab123-24642" "%2x %3x %3o %2o" a b c d
  3086. - } 4
  3087. - test scan-1.26 {integer scanning} {
  3088. -     set a {}; set b {}; set c {}; set d {}
  3089. -     scan "ab123-24642" "%2x %3x %3o %2o" a b c d
  3090. -     set a
  3091. - } 171
  3092. - test scan-1.27 {integer scanning} {
  3093. -     set a {}; set b {}; set c {}; set d {}
  3094. -     scan "ab123-24642" "%2x %3x %3o %2o" a b c d
  3095. -     set b
  3096. - } 291
  3097. - test scan-1.28 {integer scanning} {
  3098. -     set a {}; set b {}; set c {}; set d {}
  3099. -     scan "ab123-24642" "%2x %3x %3o %2o" a b c d
  3100. -     set c
  3101. - } -20
  3102. - test scan-1.29 {integer scanning} {
  3103. -     set a {}; set b {}
  3104. -     scan "ab123-24642" "%2x %3x %3o %2o" a b c d
  3105. -     set d
  3106. - } 52
  3107. - test scan-1.30 {integer scanning} {
  3108. -     set a {}; set b {}
  3109. -     scan "1234567 234 567  " "%*3x %x %*o %4o" a b
  3110. - } 2
  3111. - test scan-1.31 {integer scanning} {
  3112. -     set a {}; set b {}
  3113. -     scan "1234567 234 567  " "%*3x %x %*o %4o" a b
  3114. -     set a
  3115. - } 17767
  3116. - test scan-1.32 {integer scanning} {
  3117. -     set a {}; set b {}
  3118. -     scan "a    1234" "%d %d" a b
  3119. - } 0
  3120. - test scan-1.33 {integer scanning} {
  3121. -     set a {}
  3122. -     scan "a    1234" "%d %d" a b
  3123. -     set a
  3124. - } {}
  3125. - test scan-1.34 {integer scanning} {
  3126. -     set a {}; set b {}; set c {}; set d {};
  3127. -     scan "12345678" "%2d %2d %2d %2d" a b c d
  3128. - } 4
  3129. - test scan-1.35 {integer scanning} {
  3130. -     set a {}; set b {}; set c {}; set d {};
  3131. -     scan "12345678" "%2d %2d %2d %2d" a b c d
  3132. -     set a
  3133. - } 12
  3134. - test scan-1.36 {integer scanning} {
  3135. -     set a {}; set b {}; set c {}; set d {}
  3136. -     scan "12345678" "%2d %2d %2d %2d" a b c d
  3137. -     set b
  3138. - } 34
  3139. - test scan-1.37 {integer scanning} {
  3140. -     set a {}; set b {}; set c {}; set d {}
  3141. -     scan "12345678" "%2d %2d %2d %2d" a b c d
  3142. -     set c
  3143. - } 56
  3144. - test scan-1.38 {integer scanning} {
  3145. -     set a {}; set b {}; set c {}; set d {}
  3146. -     scan "12345678" "%2d %2d %2d %2d" a b c d
  3147. -     set d
  3148. - } 78
  3149. - test scan-1.39 {integer scanning} {
  3150. -     set a {}; set b {}; set c {}; set d {}
  3151. -     scan "1 2 " "%d %d %d %d" a b c d
  3152. - } 2
  3153. - test scan-1.40 {integer scanning} {
  3154. -     set a {}; set b {}; set c {}; set d {}
  3155. -     scan "1 2 " "%d %d %d %d" a b c d
  3156. -     set a
  3157. - } 1
  3158. - test scan-1.41 {integer scanning} {
  3159. -     set a {}; set b {}; set c {}; set d {}
  3160. -     scan "1 2 " "%d %d %d %d" a b c d
  3161. -     set b
  3162. - } 2
  3163. - test scan-1.42 {integer scanning} {
  3164. -     set a {}; set b {}; set c {}; set d {}
  3165. -     scan "1 2 " "%d %d %d %d" a b c d
  3166. - } 2
  3167. - test scan-1.43 {integer scanning} {
  3168. -     set a {}; set b {}; set c {}; set d {}
  3169. -     scan "1 2 " "%d %d %d %d" a b c d
  3170. -     set d
  3171. - } {}
  3172.   
  3173.   test scan-2.1 {floating-point scanning} {
  3174.       set a {}; set b {}; set c {}; set d {}
  3175. !     scan "2.1 -3.0e8 .99962 a" "%f%f%f%f" a b c d
  3176. ! } 3
  3177.   test scan-2.2 {floating-point scanning} {
  3178.       set a {}; set b {}; set c {}; set d {}
  3179. !     scan "2.1 -3.0e8 .99962 a" "%f%f%f%f" a b c d
  3180. !     set a
  3181. ! } 2.1
  3182.   test scan-2.3 {floating-point scanning} {
  3183. -     set a {}; set b {}; set c {}; set d {}
  3184. -     scan "2.1 -3.0e8 .99962 a" "%f%f%f%f" a b c d
  3185. -     set b
  3186. - } -3e+08
  3187. - test scan-2.4 {floating-point scanning} {
  3188. -     set a {}; set b {}; set c {}; set d {}
  3189. -     scan "2.1 -3.0e8 .99962 a" "%f%f%f%f" a b c d
  3190. -     set c
  3191. - } 0.99962
  3192. - test scan-2.5 {floating-point scanning} {
  3193. -     set a {}; set b {}; set c {}; set d {}
  3194. -     scan "2.1 -3.0e8 .99962 a" "%f%f%f%f" a b c d
  3195. -     set d
  3196. - } {}
  3197. - test scan-2.6 {floating-point scanning} {
  3198. -     set a {}; set b {}; set c {}; set d {}
  3199. -     scan "-1.2345 +8.2 9" "%3e %3f %f %f" a b c d
  3200. - } 4
  3201. - test scan-2.7 {floating-point scanning} {
  3202. -     set a {}; set b {}; set c {}; set d {}
  3203. -     scan "-1.2345 +8.2 9" "%3e %3f %f %f" a b c d
  3204. -     set a
  3205. - } -1.0
  3206. - test scan-2.8 {floating-point scanning} {
  3207. -     set a {}; set b {}; set c {}; set d {}
  3208. -     scan "-1.2345 +8.2 9" "%3e %3f %f %f" a b c d
  3209. -     set b
  3210. - } 234.0
  3211. - test scan-2.9 {floating-point scanning} {
  3212. -     set a {}; set b {}; set c {}; set d {}
  3213. -     scan "-1.2345 +8.2 9" "%3e %3f %f %f" a b c d
  3214. -     set c
  3215. - } 5.0
  3216. - test scan-2.10 {floating-point scanning} {
  3217. -     set a {}; set b {}; set c {}; set d {}
  3218. -     scan "-1.2345 +8.2 9" "%3e %3f %f %f" a b c d
  3219. -     set d
  3220. - } 8.2
  3221. - test scan-2.11 {floating-point scanning} {
  3222.       set a {}; set b {}; set c {}
  3223. !     scan "1e00004 332E-4 3e+4" "%f %*2e %f %f" a b c
  3224. ! } 3
  3225. ! test scan-2.12 {floating-point scanning} {
  3226. !     set a {}; set b {}; set c {}
  3227. !     scan "1e00004 332E-4 3e+4" "%f %*2e %f %f" a b c
  3228. !     set a
  3229. ! } 10000.0
  3230. ! test scan-2.13 {floating-point scanning} {
  3231. !     set a {}; set b {}; set c {}
  3232. !     scan "1e00004 332E-4 3e+4" "%f %*2e %f %f" a b c
  3233. !     set c
  3234. ! } 30000.0
  3235. ! if $atBerkeley {
  3236. !     test scan-2.14 {floating-point scanning} {
  3237. !     set a {}; set b {}; set c {}
  3238. !     scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c
  3239. !     } 3
  3240. ! }
  3241. ! test scan-2.15 {floating-point scanning} {
  3242. !     set a {}; set b {}; set c {}
  3243. !     scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c
  3244. !     set a
  3245. ! } 1.0
  3246. ! test scan-2.16 {floating-point scanning} {
  3247. !     set a {}; set b {}; set c {}
  3248. !     scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c
  3249. !     set b
  3250. ! } 200.0
  3251.   if $atBerkeley {
  3252. !     test scan-2.17 {floating-point scanning} {
  3253.       set a {}; set b {}; set c {}
  3254. !     scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c
  3255. !     set c
  3256. !     } 3.0
  3257. !     test scan-2.18 {floating-point scanning} {
  3258.       set a {}; set b {}
  3259. !     scan "1.eabc" "%f %x" a b
  3260. !     } 2
  3261. !     test scan-2.19 {floating-point scanning} {
  3262. !     set a {}; set b {}
  3263. !     scan "1.eabc" "%f %x" a b
  3264. !     set a
  3265. !     } 1.0
  3266.   }
  3267. ! test scan-2.20 {floating-point scanning} {
  3268. !     set a {}; set b {}; set c {}; set d {}
  3269. !     scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
  3270. ! } 4
  3271. ! test scan-2.21 {floating-point scanning} {
  3272. !     set a {}; set b {}; set c {}; set d {}
  3273. !     scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
  3274. !     set a
  3275. ! } 4.6
  3276. ! test scan-2.22 {floating-point scanning} {
  3277. !     set a {}; set b {}; set c {}; set d {}
  3278. !     scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
  3279. !     set b
  3280. ! } 99999.7
  3281. ! test scan-2.23 {floating-point scanning} {
  3282. !     set a {}; set b {}; set c {}; set d {}
  3283. !     scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
  3284. !     set c
  3285. ! } 87.643
  3286. ! test scan-2.24 {floating-point scanning} {
  3287. !     set a {}; set b {}; set c {}; set d {}
  3288. !     scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
  3289. !     set d
  3290. ! } 118.0
  3291. ! test scan-2.25 {floating-point scanning} {
  3292. !     set a {}; set b {}; set c {}; set d {}
  3293. !     scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d
  3294. ! } 4
  3295. ! test scan-2.26 {floating-point scanning} {
  3296. !     set a {}; set b {}; set c {}; set d {}
  3297. !     scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d
  3298. !     set a
  3299. ! } 1.2345
  3300. ! test scan-2.27 {floating-point scanning} {
  3301. !     set a {}; set b {}; set c {}; set d {}
  3302. !     scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d
  3303. !     set b
  3304. ! } 0.697
  3305. ! test scan-2.28 {floating-point scanning} {
  3306. !     set a {}; set b {}; set c {}; set d {}
  3307. !     scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d
  3308. !     set c
  3309. ! } 124.0
  3310. ! test scan-2.29 {floating-point scanning} {
  3311. !     set a {}; set b {}; set c {}; set d {}
  3312. !     scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d
  3313. !     set d
  3314. ! } 5e-05
  3315. ! test scan-2.30 {floating-point scanning} {
  3316. !     set a {}; set b {}; set c {}; set d {}
  3317. !     scan "4.6abc" "%f %f %f %f" a b c d
  3318. ! } 1
  3319. ! test scan-2.31 {floating-point scanning} {
  3320. !     set a {}; set b {}; set c {}; set d {}
  3321. !     scan "4.6abc" "%f %f %f %f" a b c d
  3322. !     set a
  3323. ! } 4.6
  3324. ! test scan-2.32 {floating-point scanning} {
  3325.       set a {}; set b {}; set c {}; set d {}
  3326. !     scan "4.6abc" "%f %f %f %f" a b c d
  3327. !     set b
  3328. ! } {}
  3329. ! test scan-2.33 {floating-point scanning} {
  3330. !     set a {}; set b {}; set c {}; set d {}
  3331. !     scan "4.6abc" "%f %f %f %f" a b c d
  3332. !     set c
  3333. ! } {}
  3334. ! test scan-2.34 {floating-point scanning} {
  3335. !     set a {}; set b {}; set c {}; set d {}
  3336. !     scan "4.6abc" "%f %f %f %f" a b c d
  3337. !     set d
  3338. ! } {}
  3339. ! test scan-2.35 {floating-point scanning} {
  3340. !     set a {}; set b {}; set c {}; set d {}
  3341. !     scan "4.6 5.2" "%f %f %f %f" a b c d
  3342. ! } 2
  3343. ! test scan-2.36 {floating-point scanning} {
  3344.       set a {}; set b {}; set c {}; set d {}
  3345. !     scan "4.6 5.2" "%f %f %f %f" a b c d
  3346. !     set a
  3347. ! } 4.6
  3348. ! test scan-2.37 {floating-point scanning} {
  3349.       set a {}; set b {}; set c {}; set d {}
  3350. !     scan "4.6 5.2" "%f %f %f %f" a b c d
  3351. !     set b
  3352. ! } 5.2
  3353. ! test scan-2.38 {floating-point scanning} {
  3354. !     set a {}; set b {}; set c {}; set d {}
  3355. !     scan "4.6 5.2" "%f %f %f %f" a b c d
  3356. !     set c
  3357. ! } {}
  3358. ! test scan-2.39 {floating-point scanning} {
  3359.       set a {}; set b {}; set c {}; set d {}
  3360. !     scan "4.6 5.2" "%f %f %f %f" a b c d
  3361. !     set d
  3362. ! } {}
  3363.   
  3364.   test scan-3.1 {string and character scanning} {
  3365.       set a {}; set b {}; set c {}; set d {}
  3366. !     scan "abc defghijk dum " "%s %3s %20s %s" a b c d
  3367. ! } 4
  3368.   test scan-3.2 {string and character scanning} {
  3369.       set a {}; set b {}; set c {}; set d {}
  3370. !     scan "abc defghijk dum " "%s %3s %20s %s" a b c d
  3371. !     set a
  3372. ! } abc
  3373.   test scan-3.3 {string and character scanning} {
  3374. -     set a {}; set b {}; set c {}; set d {}
  3375. -     scan "abc defghijk dum " "%s %3s %20s %s" a b c d
  3376. -     set b
  3377. - } def
  3378. - test scan-3.4 {string and character scanning} {
  3379. -     set a {}; set b {}; set c {}; set d {}
  3380. -     scan "abc defghijk dum " "%s %3s %20s %s" a b c d
  3381. -     set c
  3382. - } ghijk
  3383. - test scan-3.5 {string and character scanning} {
  3384. -     set a {}; set b {}; set c {}; set d {}
  3385. -     scan "abc defghijk dum " "%s %3s %20s %s" a b c d
  3386. -     set d
  3387. - } dum
  3388. - test scan-3.6 {string and character scanning} {
  3389. -     set a {}; set b {}; set c {}; set d {}
  3390. -     scan "a       bcdef" "%c%c%1s %s" a b c d
  3391. - } 4
  3392. - test scan-3.7 {string and character scanning} {
  3393. -     set a {}; set b {}; set c {}; set d {}
  3394. -     scan "a       bcdef" "%c%c%1s %s" a b c d
  3395. -     set a
  3396. - } 97
  3397. - test scan-3.8 {string and character scanning} {
  3398. -     set a {}; set b {}; set c {}; set d {}
  3399. -     scan "a       bcdef" "%c%c%1s %s" a b c d
  3400. -     set b
  3401. - } 32
  3402. - test scan-3.9 {string and character scanning} {
  3403. -     set a {}; set b {}; set c {}; set d {}
  3404. -     scan "a       bcdef" "%c%c%1s %s" a b c d
  3405. -     set c
  3406. - } b
  3407. - test scan-3.10 {string and character scanning} {
  3408. -     set a {}; set b {}; set c {}; set d {}
  3409. -     scan "a       bcdef" "%c%c%1s %s" a b c d
  3410. -     set d
  3411. - } cdef
  3412. - test scan-3.11 {string and character scanning} {
  3413. -     set a {}; set b {}; set c {}
  3414. -     scan "123456 test " "%*c%*s %s %s %s" a b c
  3415. - } 1
  3416. - test scan-3.12 {string and character scanning} {
  3417.       set a {}; set b {}; set c {}
  3418. !     scan "123456 test " "%*c%*s %s %s %s" a b c
  3419. !     set a
  3420. ! } test
  3421. ! test scan-3.13 {string and character scanning} {
  3422. !     set a {}; set b {}; set c {}
  3423. !     scan "123456 test " "%*c%*s %s %s %s" a b c
  3424. !     set b
  3425. ! } {}
  3426. ! test scan-3.14 {string and character scanning} {
  3427. !     set a {}; set b {}; set c {}
  3428. !     scan "123456 test " "%*c%*s %s %s %s" a b c
  3429. !     set c
  3430. ! } {}
  3431. ! test scan-3.15 {string and character scanning} {
  3432. !     set a {}; set b {}; set c {}; set d
  3433. !     scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d
  3434. ! } 4
  3435. ! test scan-3.16 {string and character scanning} {
  3436. !     set a {}; set b {}; set c {}; set d
  3437. !     scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d
  3438. !     set a
  3439. ! } abab
  3440. ! test scan-3.17 {string and character scanning} {
  3441. !     set a {}; set b {}; set c {}; set d
  3442. !     scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d
  3443. !     set b
  3444. ! } cd
  3445. ! test scan-3.18 {string and character scanning} {
  3446. !     set a {}; set b {}; set c {}; set d
  3447. !     scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d
  3448. !     set c
  3449. ! } {01234  }
  3450. ! test scan-3.19 {string and character scanning} {
  3451.       set a {}; set b {}; set c {}; set d
  3452. !     scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d
  3453. !     set d
  3454. ! } {f 12345}
  3455. ! test scan-3.20 {string and character scanning} {
  3456. !     set a {}; set b {}; set c {}
  3457. !     scan "aaaaaabc aaabcdefg  + +  XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c
  3458. ! } 3
  3459. ! test scan-3.21 {string and character scanning} {
  3460. !     set a {}; set b {}; set c {}
  3461. !     scan "aaaaaabc aaabcdefg  + +  XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c
  3462. !     set a
  3463. ! } aabc
  3464. ! test scan-3.22 {string and character scanning} {
  3465. !     set a {}; set b {}; set c {}
  3466. !     scan "aaaaaabc aaabcdefg  + +  XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c
  3467. !     set b
  3468. ! } bcdefg
  3469. ! test scan-3.23 {string and character scanning} {
  3470.       set a {}; set b {}; set c {}
  3471. !     scan "aaaaaabc aaabcdefg  + +  XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c
  3472. !     set c
  3473. ! } 43
  3474.   
  3475.   test scan-4.1 {error conditions} {
  3476.       catch {scan a}
  3477. --- 24,140 ----
  3478.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  3479.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  3480.   #
  3481. ! # $Header: /user6/ouster/tcl/tests/RCS/scan.test,v 1.16 93/07/16 16:50:35 ouster Exp $ (Berkeley)
  3482.   
  3483.   if {[string compare test [info procs test]] == 1} then {source defs}
  3484.   
  3485.   test scan-1.1 {integer scanning} {
  3486.       set a {}; set b {}; set c {}; set d {}
  3487. !     list [scan "-20 1476 \n33 0" "%d %d %d %d" a b c d] $a $b $c $d
  3488. ! } {4 -20 1476 33 0}
  3489.   test scan-1.2 {integer scanning} {
  3490. !     set a {}; set b {}; set c {}
  3491. !     list [scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c] $a $b $c
  3492. ! } {3 -4 16 7890}
  3493.   test scan-1.3 {integer scanning} {
  3494.       set a {}; set b {}; set c {}; set d {}
  3495. !     list [scan "-45 16 +10 987" "%ld %d %ld %d" a b c d] $a $b $c $d
  3496. ! } {4 -45 16 10 987}
  3497.   test scan-1.4 {integer scanning} {
  3498.       set a {}; set b {}; set c {}; set d {}
  3499. !     list [scan "14 1ab 62 10" "%d %x %lo %x" a b c d] $a $b $c $d
  3500. ! } {4 14 427 50 16}
  3501.   test scan-1.5 {integer scanning} {
  3502.       set a {}; set b {}; set c {}; set d {}
  3503. !     list [scan "12345670 1234567890ab cdefg" "%o     %o %x %lx" a b c d] \
  3504. !         $a $b $c $d
  3505. ! } {4 2739128 342391 561323 52719}
  3506.   test scan-1.6 {integer scanning} {
  3507. !     set a {}; set b {}; set c {}; set d {}
  3508. !     list [scan "ab123-24642" "%2x %3x %3o %2o" a b c d] $a $b $c $d
  3509. ! } {4 171 291 -20 52}
  3510.   test scan-1.7 {integer scanning} {
  3511. !     set a {}; set b {}
  3512. !     list [scan "1234567 234 567  " "%*3x %x %*o %4o" a b] $a $b
  3513. ! } {2 17767 375}
  3514.   test scan-1.8 {integer scanning} {
  3515. !     set a {}; set b {}
  3516. !     list [scan "a    1234" "%d %d" a b] $a $b
  3517. ! } {0 {} {}}
  3518.   test scan-1.9 {integer scanning} {
  3519. !     set a {}; set b {}; set c {}; set d {};
  3520. !     list [scan "12345678" "%2d %2d %2ld %2d" a b c d] $a $b $c $d
  3521. ! } {4 12 34 56 78}
  3522. ! test scan-1.10 {integer scanning} {
  3523. !     set a {}; set b {}; set c {}; set d {}
  3524. !     list [scan "1 2 " "%hd %d %d %d" a b c d] $a $b $c $d
  3525. ! } {2 1 2 {} {}}
  3526.   if $atBerkeley {
  3527.       test scan-1.11 {integer scanning} {
  3528. !     set a {}; set b {};
  3529. !     list [scan "4294967280 4294967280" "%u %d" a b] $a $b
  3530. !     } {2 4294967280 -16}
  3531.   }
  3532.   
  3533.   test scan-2.1 {floating-point scanning} {
  3534.       set a {}; set b {}; set c {}; set d {}
  3535. !     list [scan "2.1 -3.0e8 .99962 a" "%f%g%e%f" a b c d] $a $b $c $d
  3536. ! } {3 2.1 -3e+08 0.99962 {}}
  3537.   test scan-2.2 {floating-point scanning} {
  3538.       set a {}; set b {}; set c {}; set d {}
  3539. !     list [scan "-1.2345 +8.2 9" "%3e %3lf %f %f" a b c d] $a $b $c $d
  3540. ! } {4 -1.0 234.0 5.0 8.2}
  3541.   test scan-2.3 {floating-point scanning} {
  3542.       set a {}; set b {}; set c {}
  3543. !     list [scan "1e00004 332E-4 3e+4" "%Lf %*2e %f %f" a b c] $a $c
  3544. ! } {3 10000.0 30000.0}
  3545.   if $atBerkeley {
  3546. !     test scan-2.4 {floating-point scanning} {
  3547.       set a {}; set b {}; set c {}
  3548. !     list [scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c] $a $b $c
  3549. !     } {3 1.0 200.0 3.0}
  3550. !     test scan-2.5 {floating-point scanning} {
  3551.       set a {}; set b {}
  3552. !     list [scan "1.eabc" "%f %x" a b] $a $b
  3553. !     } {2 1.0 2748}
  3554.   }
  3555. ! test scan-2.6 {floating-point scanning} {
  3556.       set a {}; set b {}; set c {}; set d {}
  3557. !     list [scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d] $a $b $c $d
  3558. ! } {4 4.6 99999.7 87.643 118.0}
  3559. ! test scan-2.7 {floating-point scanning} {
  3560.       set a {}; set b {}; set c {}; set d {}
  3561. !     list [scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d] $a $b $c $d
  3562. ! } {4 1.2345 0.697 124.0 5e-05}
  3563. ! test scan-2.8 {floating-point scanning} {
  3564.       set a {}; set b {}; set c {}; set d {}
  3565. !     list [scan "4.6abc" "%f %f %f %f" a b c d] $a $b $c $d
  3566. ! } {1 4.6 {} {} {}}
  3567. ! test scan-2.9 {floating-point scanning} {
  3568.       set a {}; set b {}; set c {}; set d {}
  3569. !     list [scan "4.6 5.2" "%f %f %f %f" a b c d] $a $b $c $d
  3570. ! } {2 4.6 5.2 {} {}}
  3571.   
  3572.   test scan-3.1 {string and character scanning} {
  3573.       set a {}; set b {}; set c {}; set d {}
  3574. !     list [scan "abc defghijk dum " "%s %3s %20s %s" a b c d] $a $b $c $d
  3575. ! } {4 abc def ghijk dum}
  3576.   test scan-3.2 {string and character scanning} {
  3577.       set a {}; set b {}; set c {}; set d {}
  3578. !     list [scan "a       bcdef" "%c%c%1s %s" a b c d] $a $b $c $d
  3579. ! } {4 97 32 b cdef}
  3580.   test scan-3.3 {string and character scanning} {
  3581.       set a {}; set b {}; set c {}
  3582. !     list [scan "123456 test " "%*c%*s %s %s %s" a b c] $a $b $c
  3583. ! } {1 test {} {}}
  3584. ! test scan-3.4 {string and character scanning} {
  3585.       set a {}; set b {}; set c {}; set d
  3586. !     list [scan "ababcd01234  f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d] $a $b $c $d
  3587. ! } {4 abab cd {01234  } {f 12345}}
  3588. ! test scan-3.5 {string and character scanning} {
  3589.       set a {}; set b {}; set c {}
  3590. !     list [scan "aaaaaabc aaabcdefg  + +  XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c] $a $b $c
  3591. ! } {3 aabc bcdefg 43}
  3592.   
  3593.   test scan-4.1 {error conditions} {
  3594.       catch {scan a}
  3595. ***************
  3596. *** 556,656 ****
  3597.       set msg
  3598.   } {too many fields to scan}
  3599.   test scan-4.5 {error conditions} {
  3600. !     catch {scan a %z}
  3601. ! } 1
  3602.   test scan-4.6 {error conditions} {
  3603. !     catch {scan a %z} msg
  3604. !     set msg
  3605. ! } {bad scan conversion character "z"}
  3606.   test scan-4.7 {error conditions} {
  3607. !     catch {scan a "%d %d" a}
  3608. ! } 1
  3609.   test scan-4.8 {error conditions} {
  3610. !     catch {scan a "%d %d" a} msg
  3611. !     set msg
  3612. ! } {different numbers of variable names and field specifiers}
  3613.   test scan-4.9 {error conditions} {
  3614. !     catch {scan a "%d %d" a b c}
  3615. ! } 1
  3616.   test scan-4.10 {error conditions} {
  3617. !     catch {scan a "%d %d" a b c} msg
  3618. !     set msg
  3619. ! } {different numbers of variable names and field specifiers}
  3620.   test scan-4.11 {error conditions} {
  3621. !     set a {}; set b {}; set c {}; set d {}
  3622. !     expr {[scan "  a" " a %d %d %d %d" a b c d] <= 0}
  3623. ! } 1
  3624.   test scan-4.12 {error conditions} {
  3625.       set a {}; set b {}; set c {}; set d {}
  3626. !     scan "  a" " a %d %d %d %d" a b c d
  3627. !     set a
  3628. ! } {}
  3629.   test scan-4.13 {error conditions} {
  3630.       set a {}; set b {}; set c {}; set d {}
  3631. !     scan "  a" " a %d %d %d %d" a b c d
  3632. !     set b
  3633. ! } {}
  3634.   test scan-4.14 {error conditions} {
  3635. -     set a {}; set b {}; set c {}; set d {}
  3636. -     scan "  a" " a %d %d %d %d" a b c d
  3637. -     set c
  3638. - } {}
  3639. - test scan-4.15 {error conditions} {
  3640. -     set a {}; set b {}; set c {}; set d {}
  3641. -     scan "  a" " a %d %d %d %d" a b c d
  3642. -     set d
  3643. - } {}
  3644. - test scan-4.16 {error conditions} {
  3645. -     set a {}; set b {}; set c {}; set d {}
  3646. -     scan "1 2" "%d %d %d %d" a b c d
  3647. - } 2
  3648. - test scan-4.17 {error conditions} {
  3649. -     set a {}; set b {}; set c {}; set d {}
  3650. -     scan "1 2" "%d %d %d %d" a b c d
  3651. -     set a
  3652. - } 1
  3653. - test scan-4.18 {error conditions} {
  3654. -     set a {}; set b {}; set c {}; set d {}
  3655. -     scan "1 2" "%d %d %d %d" a b c d
  3656. -     set b
  3657. - } 2
  3658. - test scan-4.19 {error conditions} {
  3659. -     set a {}; set b {}; set c {}; set d {}
  3660. -     scan "1 2" "%d %d %d %d" a b c d
  3661. -     set c
  3662. - } {}
  3663. - test scan-4.20 {error conditions} {
  3664. -     set a {}; set b {}; set c {}; set d {}
  3665. -     scan "1 2" "%d %d %d %d" a b c d
  3666. -     set d
  3667. - } {}
  3668. - test scan-4.21 {error conditions} {
  3669.       catch {unset a}
  3670.       set a(0) 44
  3671.       list [catch {scan 44 %d a} msg] $msg
  3672.   } {1 {couldn't set variable "a"}}
  3673. ! test scan-4.22 {error conditions} {
  3674.       catch {unset a}
  3675.       set a(0) 44
  3676.       list [catch {scan 44 %c a} msg] $msg
  3677.   } {1 {couldn't set variable "a"}}
  3678. ! test scan-4.23 {error conditions} {
  3679.       catch {unset a}
  3680.       set a(0) 44
  3681.       list [catch {scan 44 %s a} msg] $msg
  3682.   } {1 {couldn't set variable "a"}}
  3683. ! test scan-4.24 {error conditions} {
  3684.       catch {unset a}
  3685.       set a(0) 44
  3686.       list [catch {scan 44 %f a} msg] $msg
  3687.   } {1 {couldn't set variable "a"}}
  3688. ! test scan-4.25 {error conditions} {
  3689.       catch {unset a}
  3690.       set a(0) 44
  3691.       list [catch {scan 44 %f a} msg] $msg
  3692.   } {1 {couldn't set variable "a"}}
  3693.   catch {unset a}
  3694. ! test scan-4.26 {error conditions} {
  3695.       list [catch {scan 44 %2c a} msg] $msg
  3696.   } {1 {field width may not be specified in %c conversion}}
  3697.   
  3698. --- 151,211 ----
  3699.       set msg
  3700.   } {too many fields to scan}
  3701.   test scan-4.5 {error conditions} {
  3702. !     list [catch {scan a %D} msg] $msg
  3703. ! } {1 {bad scan conversion character "D"}}
  3704.   test scan-4.6 {error conditions} {
  3705. !     list [catch {scan a %O} msg] $msg
  3706. ! } {1 {bad scan conversion character "O"}}
  3707.   test scan-4.7 {error conditions} {
  3708. !     list [catch {scan a %X} msg] $msg
  3709. ! } {1 {bad scan conversion character "X"}}
  3710.   test scan-4.8 {error conditions} {
  3711. !     list [catch {scan a %F} msg] $msg
  3712. ! } {1 {bad scan conversion character "F"}}
  3713.   test scan-4.9 {error conditions} {
  3714. !     list [catch {scan a %E} msg] $msg
  3715. ! } {1 {bad scan conversion character "E"}}
  3716.   test scan-4.10 {error conditions} {
  3717. !     list [catch {scan a "%d %d" a} msg] $msg
  3718. ! } {1 {different numbers of variable names and field specifiers}}
  3719.   test scan-4.11 {error conditions} {
  3720. !     list [catch {scan a "%d %d" a b c} msg] $msg
  3721. ! } {1 {different numbers of variable names and field specifiers}}
  3722.   test scan-4.12 {error conditions} {
  3723.       set a {}; set b {}; set c {}; set d {}
  3724. !     list [expr {[scan "  a" " a %d %d %d %d" a b c d] <= 0}] $a $b $c $d
  3725. ! } {1 {} {} {} {}}
  3726.   test scan-4.13 {error conditions} {
  3727.       set a {}; set b {}; set c {}; set d {}
  3728. !     list [scan "1 2" "%d %d %d %d" a b c d] $a $b $c $d
  3729. ! } {2 1 2 {} {}}
  3730.   test scan-4.14 {error conditions} {
  3731.       catch {unset a}
  3732.       set a(0) 44
  3733.       list [catch {scan 44 %d a} msg] $msg
  3734.   } {1 {couldn't set variable "a"}}
  3735. ! test scan-4.15 {error conditions} {
  3736.       catch {unset a}
  3737.       set a(0) 44
  3738.       list [catch {scan 44 %c a} msg] $msg
  3739.   } {1 {couldn't set variable "a"}}
  3740. ! test scan-4.16 {error conditions} {
  3741.       catch {unset a}
  3742.       set a(0) 44
  3743.       list [catch {scan 44 %s a} msg] $msg
  3744.   } {1 {couldn't set variable "a"}}
  3745. ! test scan-4.17 {error conditions} {
  3746.       catch {unset a}
  3747.       set a(0) 44
  3748.       list [catch {scan 44 %f a} msg] $msg
  3749.   } {1 {couldn't set variable "a"}}
  3750. ! test scan-4.18 {error conditions} {
  3751.       catch {unset a}
  3752.       set a(0) 44
  3753.       list [catch {scan 44 %f a} msg] $msg
  3754.   } {1 {couldn't set variable "a"}}
  3755.   catch {unset a}
  3756. ! test scan-4.19 {error conditions} {
  3757.       list [catch {scan 44 %2c a} msg] $msg
  3758.   } {1 {field width may not be specified in %c conversion}}
  3759.   
  3760. ***************
  3761. *** 687,693 ****
  3762.   test scan-6.6 {miscellaneous tests} {
  3763.       set tcl_precision 10
  3764.       set a {}
  3765. !     scan 1.111122223333 %F a
  3766.       unset tcl_precision
  3767.       set a
  3768.   } {1.111122223}
  3769. --- 242,255 ----
  3770.   test scan-6.6 {miscellaneous tests} {
  3771.       set tcl_precision 10
  3772.       set a {}
  3773. !     scan 1.111122223333 %lf a
  3774. !     unset tcl_precision
  3775. !     set a
  3776. ! } {1.111122223}
  3777. ! test scan-6.7 {miscellaneous tests} {
  3778. !     set tcl_precision 10
  3779. !     set a {}
  3780. !     scan 1.111122223333 %f a
  3781.       unset tcl_precision
  3782.       set a
  3783.   } {1.111122223}
  3784. *** ../tcl7.0b1/./tests/uplevel.test    Sat Feb  6 15:54:01 1993
  3785. --- ./tests/uplevel.test    Sat Jul 17 14:38:25 1993
  3786. ***************
  3787. *** 24,30 ****
  3788.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  3789.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  3790.   #
  3791. ! # $Header: /user6/ouster/tcl/tests/RCS/uplevel.test,v 1.10 93/02/06 15:54:00 ouster Exp $ (Berkeley)
  3792.   
  3793.   if {[string compare test [info procs test]] == 1} then {source defs}
  3794.   
  3795. --- 24,30 ----
  3796.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  3797.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  3798.   #
  3799. ! # $Header: /user6/ouster/tcl/tests/RCS/uplevel.test,v 1.11 93/07/17 14:38:22 ouster Exp $ (Berkeley)
  3800.   
  3801.   if {[string compare test [info procs test]] == 1} then {source defs}
  3802.   
  3803. ***************
  3804. *** 75,97 ****
  3805.   test uplevel-2.5 {relative and absolute uplevel} {set x} 555
  3806.   test uplevel-2.6 {relative and absolute uplevel} {set y} 666
  3807.   
  3808. ! test uplevel-3.1 {error: non-existent level} {
  3809.       list [catch c1 msg] $msg
  3810.   } {1 {bad level "#2"}}
  3811. ! test uplevel-3.2 {error: non-existent level} {
  3812.       proc c2 {} {uplevel 3 {set a b}}
  3813.       list [catch c2 msg] $msg
  3814.   } {1 {bad level "3"}}
  3815. ! test uplevel-3.3 {error: already at global level} {
  3816. !     list [catch {uplevel gorp} msg] $msg
  3817. ! } {1 {already at top level}}
  3818. ! test uplevel-3.4 {error: already at global level} {
  3819. !     list [catch {uplevel 1 gorp} msg] $msg
  3820. ! } {1 {already at top level}}
  3821. ! test uplevel-3.5 {error: not enough args} {
  3822.       list [catch uplevel msg] $msg
  3823.   } {1 {wrong # args: should be "uplevel ?level? command ?arg ...?"}}
  3824. ! test uplevel-3.6 {error: not enough args} {
  3825.       proc upBug {} {uplevel 1}
  3826.       list [catch upBug msg] $msg
  3827.   } {1 {wrong # args: should be "uplevel ?level? command ?arg ...?"}}
  3828. --- 75,111 ----
  3829.   test uplevel-2.5 {relative and absolute uplevel} {set x} 555
  3830.   test uplevel-2.6 {relative and absolute uplevel} {set y} 666
  3831.   
  3832. ! test uplevel-3.1 {uplevel to same level} {
  3833. !     set x 33
  3834. !     uplevel #0 set x 44
  3835. !     set x
  3836. ! } 44
  3837. ! test uplevel-3.2 {uplevel to same level} {
  3838. !     set x 33
  3839. !     uplevel 0 set x
  3840. ! } 33
  3841. ! test uplevel-3.3 {uplevel to same level} {
  3842. !     set y xxx
  3843. !     proc a1 {} {set y 55; uplevel 0 set y 66; return $y}
  3844. !     a1
  3845. ! } 66
  3846. ! test uplevel-3.4 {uplevel to same level} {
  3847. !     set y zzz
  3848. !     proc a1 {} {set y 55; uplevel #1 set y}
  3849. !     a1
  3850. ! } 55
  3851. ! test uplevel-4.1 {error: non-existent level} {
  3852.       list [catch c1 msg] $msg
  3853.   } {1 {bad level "#2"}}
  3854. ! test uplevel-4.2 {error: non-existent level} {
  3855.       proc c2 {} {uplevel 3 {set a b}}
  3856.       list [catch c2 msg] $msg
  3857.   } {1 {bad level "3"}}
  3858. ! test uplevel-4.3 {error: not enough args} {
  3859.       list [catch uplevel msg] $msg
  3860.   } {1 {wrong # args: should be "uplevel ?level? command ?arg ...?"}}
  3861. ! test uplevel-4.4 {error: not enough args} {
  3862.       proc upBug {} {uplevel 1}
  3863.       list [catch upBug msg] $msg
  3864.   } {1 {wrong # args: should be "uplevel ?level? command ?arg ...?"}}
  3865. ***************
  3866. *** 105,109 ****
  3867.       set y [info level 1]
  3868.   }
  3869.   a2
  3870. ! test uplevel-4.1 {info level} {set x} 1
  3871. ! test uplevel-4.2 {info level} {set y} a3
  3872. --- 119,123 ----
  3873.       set y [info level 1]
  3874.   }
  3875.   a2
  3876. ! test uplevel-5.1 {info level} {set x} 1
  3877. ! test uplevel-5.2 {info level} {set y} a3
  3878. *** ../tcl7.0b1/./tests/upvar.test    Sat May  1 16:01:11 1993
  3879. --- ./tests/upvar.test    Sat Jul 17 14:38:22 1993
  3880. ***************
  3881. *** 24,30 ****
  3882.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  3883.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  3884.   #
  3885. ! # $Header: /user6/ouster/tcl/tests/RCS/upvar.test,v 1.3 93/05/01 16:01:10 ouster Exp $ (Berkeley)
  3886.   
  3887.   if {[string compare test [info procs test]] == 1} then {source defs}
  3888.   
  3889. --- 24,30 ----
  3890.   # ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  3891.   # PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  3892.   #
  3893. ! # $Header: /user6/ouster/tcl/tests/RCS/upvar.test,v 1.4 93/07/17 14:38:10 ouster Exp $ (Berkeley)
  3894.   
  3895.   if {[string compare test [info procs test]] == 1} then {source defs}
  3896.   
  3897. ***************
  3898. *** 256,281 ****
  3899.       p1
  3900.   } {abcde 44}
  3901.   
  3902. ! test upvar-7.1 {errors in upvar command} {
  3903.       list [catch upvar msg] $msg
  3904.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3905. ! test upvar-7.2 {errors in upvar command} {
  3906.       list [catch {upvar 1} msg] $msg
  3907.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3908. ! test upvar-7.3 {errors in upvar command} {
  3909. !     list [catch {upvar a b} msg] $msg
  3910. ! } {1 {already at top level}}
  3911. ! test upvar-7.4 {errors in upvar command} {
  3912. !     list [catch {upvar 1 a b} msg] $msg
  3913. ! } {1 {already at top level}}
  3914. ! test upvar-7.5 {errors in upvar command} {
  3915. !     list [catch {upvar #0 a b} msg] $msg
  3916. ! } {1 {already at top level}}
  3917. ! test upvar-7.6 {errors in upvar command} {
  3918.       proc p1 {} {upvar a b c}
  3919.       list [catch p1 msg] $msg
  3920.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3921. ! test upvar-7.7 {errors in upvar command} {
  3922.       proc p1 {} {set a 33; upvar b a}
  3923.       list [catch p1 msg] $msg
  3924.   } {1 {variable "a" already exists}}
  3925. --- 256,303 ----
  3926.       p1
  3927.   } {abcde 44}
  3928.   
  3929. ! test upvar-7.1 {upvar to same level} {
  3930. !     set x 44
  3931. !     set y 55
  3932. !     catch {unset uv}
  3933. !     upvar #0 x uv
  3934. !     set uv abc
  3935. !     upvar 0 y uv
  3936. !     set uv xyzzy
  3937. !     list $x $y
  3938. ! } {abc xyzzy}
  3939. ! test upvar-7.2 {upvar to same level} {
  3940. !     set x 1234
  3941. !     set y 4567
  3942. !     proc p1 {x y} {
  3943. !     upvar 0 x uv
  3944. !     set uv $y
  3945. !     return "$x $y"
  3946. !     }
  3947. !     p1 44 89
  3948. ! } {89 89}
  3949. ! test upvar-7.3 {upvar to same level} {
  3950. !     set x 1234
  3951. !     set y 4567
  3952. !     proc p1 {x y} {
  3953. !     upvar #1 x uv
  3954. !     set uv $y
  3955. !     return "$x $y"
  3956. !     }
  3957. !     p1 xyz abc
  3958. ! } {abc abc}
  3959. ! test upvar-8.1 {errors in upvar command} {
  3960.       list [catch upvar msg] $msg
  3961.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3962. ! test upvar-8.2 {errors in upvar command} {
  3963.       list [catch {upvar 1} msg] $msg
  3964.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3965. ! test upvar-8.3 {errors in upvar command} {
  3966.       proc p1 {} {upvar a b c}
  3967.       list [catch p1 msg] $msg
  3968.   } {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  3969. ! test upvar-8.4 {errors in upvar command} {
  3970.       proc p1 {} {set a 33; upvar b a}
  3971.       list [catch p1 msg] $msg
  3972.   } {1 {variable "a" already exists}}
  3973.